- Home /
Fix "Type size exists in both System.drawing and netstandard"
Tried using aliases but I don't know how to get them to work with Unity compiler. I am trying to take a screenshot (NOT of the game, of the entire screen) and create a texture from it. I need to be able to use Size but it exists in both.
EDIT: Removing the "using System.Drawing" line causes the type "Size" to no longer be found.
Answer by sacredgeometry · Mar 07 at 08:22 AM
Aliases work exactly the same in Unity as anywhere else
using MyTypeAlias = Namespace.SomeTime;
Alternatively you could just fully qualify the type based on which one it is you are trying to use i.e.
System.Drawing.Size
System.Drawing.Size exists in System.Drawing and net standard so I can’t just use full name or basic alias
What do you mean? Why are you referencing two versions of the .Net framework? That is not something you can/ should do.
Double check you havent got duplicate or unnecessary assembly references
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
No Monobehaviour script in the file error Unity 2019.2 2 Answers
type not found 1 Answer
Distribute terrain in zones 3 Answers
Problem with var in C# (Vector3, transform and similiar) 1 Answer