Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by TheMajesticSpud · Jul 15, 2017 at 07:02 PM · c#visual studiocompiler error

System.Drawing namespace not consistently found (Unity version 5.6.2f1)

This is hopefully not the same as anyone else's problem but, even though both Visual Studio and MonoDevelop apparently have no difficulty accessing the "Sytem.Drawing" namespace once an assembly reference has been created, the Unity Editor throws CS0234 "The type or namespace name 'Drawing' does not exist in the namespace `System'. Are you missing 'System.Drawing' assembly reference?", and by extension CS0246 "The type or namespace name 'Bitmap' could not be found. Are you missing an assembly reference?", compile errors. I have tried everything else I could find on the forums. Thank you for your time!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Bunny83 · Jul 15, 2017 at 07:13 PM

You can't add assembly references inside Visual Studio or MonoDevelop. Usually when you develop a .NET or Mono application you need the .NET framework or Mono installed on the PC. That way the application has access to all assemblies that are included in the framework.

Unity however uses Mono as standalone scripting environment. Every assembly that you want to use has to be physically added to your project. So you have to copy the assembly and all it dependencies into your assets folder. Unity automatically adds the references to the C# project. The C# project actually isn't "used" at all. Unity has it's own build command. It directly calls the mono compiler when you build the game.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Glurth · Jul 15, 2017 at 07:27 PM 1
Share

Just to be specific: search your system for system.drawing.dll, and copy it into your project's assets folder. I found a few various versions in subfolders of:

C:\Program Files (x86)\Reference Assemblies\$$anonymous$$icrosoft\Framework.NETFramework\

and

C:\Program Files\Unity\Editor\Data\$$anonymous$$onoBleedingEdge\lib\mono\

Not sure which one you should actually use though... the newest, I guess?

avatar image Bunny83 Glurth · Jul 15, 2017 at 07:32 PM 0
Share

I would recommend to use the mono version. First using the microsoft version could (in theory) cause licensing issues. Even something might be free, you may not be allowed to re-distribute parts of it. I did not read through the .NET EULA. The mono version is allowed to by included.

Also since there are slight differences between $$anonymous$$ono and .NET it has a higher chance to be compatible with the rest of the framework. Of course there are exceptions to that "rule" -.-

avatar image Jon_Brant Glurth · Nov 10, 2020 at 08:54 AM 0
Share

Oh man, thank you. I should have thought of this myself, but I have the dumb.

avatar image TheMajesticSpud · Jul 15, 2017 at 07:40 PM 0
Share

This worked! Thank you both very much for your help. I will keep in $$anonymous$$d what you have said in future.

avatar image
8

Answer by FadeToBlack · Apr 15, 2019 at 05:35 AM

The proper way to include dotNet library not linked in Unity3d:

  1. Create a new text file named mcs.rsp in your Unity project's root Assets directory.

  2. On the first line in the empty text file, enter: -r:System.Net.Http.dll and then save the file. You can replace "System.Net.Http.dll" with any included assembly that might be missing a reference.

  3. Restart the Unity editor.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EZaca · Sep 18, 2019 at 02:28 PM 1
Share

And Unity documentation states "Don’t copy them into the Project directory." (docs). This should be the accepted answer.

avatar image Nelugo · Nov 25, 2019 at 11:19 PM 0
Share

Working like a charm in Unity editor and Visual Studio. It have to be the accepted answer.

avatar image PawelSlusarczyk · Mar 04, 2020 at 11:04 AM 0
Share

It doesn't work when I have an assembly definition file in the root of my project. Any clues? After removing the assembly definition file, it properly gets the .DLL. Also, it the compiler doesn't see the DLL when I build the project.

avatar image LoliconUn · Jun 10, 2020 at 06:01 AM 0
Share

Save my life.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

358 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Particleellipsoidemitter is missing from Unity 5 library 0 Answers

Get Random Number for each player from Dice 1 Answer

Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges