Unity , C# Error CS0012 : The type 'Color' is defined in an assembly that is not referenced

1.2k Views Asked by At

i use Unity version 2020.1.11f1

I am trying to create Docs using the Xceed library. However, every time I mention Color, I get the following error : error CS0012: The type 'Color' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

example code:

s1.Color = Color.red;
s1.Bind( brazil, "Category", "Expenses" );
c.AddSeries( s1 );

I tried to use this : [System.ComponentModel.TypeConverter("System.Drawing.Color, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]

along with this code:

s1.Color = System.Drawing.Color.Green;

and now the error looks like this:

error CS1069: The type name 'Color' could not be found in the namespace 'System.Drawing'. This type has been forwarded to assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

1

There are 1 best solutions below

0
влад почобут On BEST ANSWER

The solution was that the Xceed bundle had lost its reference to the System.Drawning.Color library or could not pull it up. When adding the library to the directory, the problem was solved.