1
votes

I am trying to add foreground color to a textblock in Windows Phone 8.1 App. For this, I have added a reference to dll "System.Drawing".

The error ("Cannot find type System.MarshalByRefObject in module mscorlib.dll.") is shown for this line while building the solution txtBlock.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(100,200,100,200));

and for this as well

txtSubject.Foreground = new SolidColorBrush(Windows.UI.Colors.Beige);
2

2 Answers

1
votes

Remove the System.Drawing" reference, it is not compatible with Windows Phone 8.1 and you do not need it.

0
votes

Try to create the brush on the UI thread by using a Dispatcher.