Hello. I am completely new to this and I am going thru some tutorials. Now I have encountered an error. Whever I try to make a C# script it says on both UnityEngine and MonoBehaviour (that are also marked in red) "Error CS0103 - the name does not exist in the current context". I have searched for this on Google and many people seem to have this error, yet no solution I have found has worked. I have tried to change to Net 4.5. Nothing works. Please help.
Well, it works outside of the MonoDevelop. When I hit the play button it runs as it should. I made a new C# without any written code and took a print screen to show you, here -
In that case, it's likely just the references in the project - if you choose "Open C# project" from the assets menu, it should rebuild the project.
This is the error I am getting. Nothing works to fix it. Build failed. Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
It doesnt matter wich I chose. Still the same issue. I should also mention I have enabled .NET 3.5 in Windows.
I don't even have an option to reference to anything above 3.5. But I am new to all this, I am maybe doing something wrong. Even if I start a new project and try to make a C# script I get this error at once.
Try reinstalling, something is funky, maybe a default project template is messed up but that error means that something is referencing System.Web from .NET 4.x.
I have reinstalled now. Without any errors. But the problem is still there Like this. On a new install of Unity and a new project. And as you can see, it is set to .Net 3.5. Here is another one having the exact same problem. Seems like no one knows what it is. http://answers.unity3d.com/questions/1239502/errors-cs0103-monodevelop.html Here you can see what happens when I try to debug code in Monodevelop. I get that System.web error. However, if I run it in Unity directly, I get no errors at all. It doesnt make any sense. To me, of course, I have only used Unity for five days now. But I am guessing somthings messed up in my Windows. It's wierd though, I get no problems with anything else. No other programs nor games is getting messed up.
My advice... stop using MonoDevlop. It's garbage. Download Visual Studio 2017 Community edition. It's free. And make sure you choose visual studio tools for unity when you install.
Yes. I have decided to try that. So annoying to have these kind of errors now. Like its not enough for me to learn both Unity and C#
If I recall, I think I saw someone who mentioned that for some reason the project in Monodevelop was referencing UnityEngine.dll from the wrong Unity version causing it not to load, but I'm not positive. Visual Studio will make you so much happier though.
I know now that it works with framework 3.5 as long as I untick "Use msbuild engine". However it gives the error when I try to debug again. But could this be somthing with ms build that is wrong? Can I get a never/other ms build?
No, Monodevelop. The reason I really want to use it still is because I have found a very good channel on youtube with over 140videos about Unity and C#. I have watched his videos for two days now and from knowing nothing about C# I now know some very bassic foundations. I really want to use Monodevelop for now, since it is what he is using as well, it makes it easier for me as a begginer.