- Home /
MonoDevelop 4.0.1 won't recognize "UnityEngine" namespace
Since upgrading to Unity 4.3 and MonoDevelop 4.0.1, building any C# script in mono hits me with a "The type or namespace name 'UnityEngine' could not be found. Are you missing a using directive or an assembly reference?"
This happens with scripts that worked in the previous version of Unity/Mono, and also for any brand new scripts created in Unity. Also, the "build all" option is greyed out and not usable. Am I overlooking something extremely simple here?
FIXED - Go to Unity preferences -> External Tools -> External Script Editor, select the drop down and manually select MonoDevelop. Worked for me.
Same problem here. I'm running OS-X 10.9 ($$anonymous$$avericks). I just upgraded to Unity 4.3 Pro a few hours ago. I assume you tried the obvious such as Assets->Synch $$anonymous$$onoDevelop Project? This did not make any difference with my issues.
Did you register a ticket yet with Unity support? I will fire up the Unity bug reporter and send one in myself.
Yep, I'm running on $$anonymous$$avericks as well. Didn't send a ticket yet, I've been too busy trying to fix it. Probably should have done that.
Ahh...that's great to know - thanks! I figured it was their new file system tweaks with the attributes causing the gremlins. I'm also getting new folder appearing in Unity after the failed compile - bin and debug - are you too? I have my file system set to show hidden folders so wasn't sure if that was causing the problem or not.
Ticket sent - but I also sent one about a month ago for a similar issue under v4.2.2, along with 2 updates and never got a single response out of them.
I am getting those folders as well. Don't think I have hidden folders enabled.
I never build through $$anonymous$$D - just let Unity do it (build in $$anonymous$$onoDevelop is turned off for all of my projects) - I just tab to Unity and let it build. There can be errors that occur in $$anonymous$$D builds that don't occur in Unity and it actually does a recompile of the compiled DLLs anyway...
Answer by dilbertian · Nov 13, 2013 at 05:42 AM
This fixed this issue: http://forum.unity3d.com/threads/210405-Unity-4-3-how-do-you-associate-Monodevelop-with-the-Unity-project-Sync-doesn-t-work
However, Unity then becomes unstable and crashes should you try and Quit Unity or Open another project.
Unity Save Scene and Save Project seem to work fine. You will just need to reset the $$anonymous$$onoDevelop.App association each time you load Unity as this setting does not get saved.
Unity contacted me today and had me run a complete re-install which totally fixed the problem. It appears there may have been a permission error on the folder which stores the user preferences during the initial install/upgrade as I had been on 4.2.2 previously. To verify if you have the permission error, go to ~/Library/Preferences and there should be 2 files named com.unity3d.unity... in there. If you don't see them there, do the re-install.
Answer by BloodFox__88 · Jan 27, 2017 at 09:27 AM
I could not find the solution on any of the forums answers or otherwise. So I started clicking stuff and found something that worked!
I use monodevelop for CS and Unity script and just updated unity 5.5.1. Then for some reason in my CS scripts the "using UnityEngine;" was red along with a lot of other unity specific functions, code hints were gone as well.
what worked:
in Monodevelop goto: Project -> Solution Options
run -> StartUp Project
then change the option from "Single Startup Project" to "Multiple Startup Project" and check all the radios for all the options available "Assembly-CSharp-firstpass"....then click ok
then restart the editor.
Then everything worked for me,... no more red error text, code hints came back. :) Hope this helps. Joshua Carlos
Thanks, I had this problem when I upgraded to 5.5.1f1 and was trawling the web for an answers, none of which worked, but this did, cheers mate!
This also worked very well for me after updating to 5.5.1p2. Have you guys noticed also after the upgrade that you unity is crashing and also causing your mac to crash?
Answer by kaan2015 · Oct 05, 2015 at 07:48 PM
Good answers. Thanks. More precisely ... Unity -> Edit ->Preference ->External Tools ->External Script Editor-> MonoDevelop(bilt-in). All Right. Previously, Visual Studio 2015 was.
Answer by fahadshafique · Jul 03, 2017 at 05:58 AM
Some times its the problem of .NetFramework installed in your PC...mono develop may be using .netFramework version which is not installed in your PC as a reference..so need to change version of .netFramework in monodevelop settings
For this: Go to MonoDevelop "Project" ->"Assembly-C Sharp Options" ->"Build"->"General" Now Change "Target Framework" according to the version of the .netFrameWork installed in your computer
Thanks a lot !!! I had this problem with Unity 5.6.3f1, I´ve tried with different solutions without success and this was the only one that worked.
Answer by mkgame · Aug 06, 2017 at 10:58 AM
I had the same trouble Unity5.6.3/Monodevelop 5.9.6, nothing helped me here. I couldn't open the Visual Studio, so then I tried with MonoDevelop, where all the UnityEngine namespace dependent classes were not recognized.
Because the C# project will be generated automatically, just delete all the c# project releated files under your Unity game project directory. Then a clean working project will be generated after you open the project with MonoDevelop (e.g. double click on a .cs file in Unity).
Remove files which ends with: .csproj, .unityproj, .sln
After this I didn't missed anything in a 100GB project on which I working since 3 years.
Your answer
Follow this Question
Related Questions
How can i shuffle a list 5 Answers
How to know which code depends on System.dll in mono C#? 1 Answer
how to debug in monodevelop 1 Answer
A node in a childnode? 1 Answer