Bug 11493 - MonoDevelop 2.8.2 'Mono / .NET 3.5' error and mscorlib not found, WinXP SP3
Summary: MonoDevelop 2.8.2 'Mono / .NET 3.5' error and mscorlib not found, WinXP SP3
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 2.8.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-31 16:27 UTC by artistartis
Modified: 2013-04-01 16:33 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Solution window for script that comes with Unity3D (234.09 KB, image/jpeg)
2013-03-31 16:27 UTC, artistartis
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DOWNSTREAM

Description artistartis 2013-03-31 16:27:27 UTC
Created attachment 3724 [details]
Solution window for script that comes with Unity3D

Greetings. 

All I want and expect is to simply write Unity scripts on MonoDevelop. But instead I get a (*2)"Error: Framework 'Mono / .NET 3.5' not installed (Assembly-CSharp-firstpass)" on the MonoDevelop and on the MonoDevelop Message Log it says "mscorlib assembly not found for framework '.NETFramework,Version=v3.5' The framework may not be installed" (*1). I’m getting that message with scripts that come with Unity (Camera Scripts, General Scripts and Utility Scripts), but also even when I just created a new script -- even when the script is empty!

First I'd like to give some specifications:
Operating System: Windows 5.1.2600.196608 --> Windows XP Professional Version 2002 Service Pack 3
Runtime:
	Microsoft .NET 4.0.30319.1
	GTK 2.12.10 (GTK# 2.12.0.0)
Loaded assemblies:
(*1) mscorlib     4.0.0.0        C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll
                                          ...
^ as you can see mscorlib is a loaded assembly, so why the message "mscorlib assembly not found for framework"? 

(*2) I already have Microsoft .NET Framework 4 Extended (and Client Profile) installed so I believe I need to make Unity recognize it. And I wonder why would Unity 4 ask for an older .NET Framework. I recently read that: 

<< "Assembly" is the name for a .NET library. "Assembly not available for Mono / .NET 3.5" means "I cannot find the library you're trying to use" >> (http://tinyurl.com/directhexNov27th2010)

Does this help? How can I help Unity find a library? How do I use a library that Unity can find? Attached is one screen shots of the problem.

I did all I could so far. I searched the web for "Error: Framework 'Mono / .NET 3.5' not installed. (Assembly-CSharp-firstpass)", they talk about changing "the project to use the full 4.0 framework" (http://tinyurl.com/cyr2uwv) and I have no idea how to do that on Unity. I also searched for "mscorlib assembly not found for framework" and the results don't seem to help at all, they talk about redhat, ubuntu, and the ones related to MonoDevelop don't help this specific issue. I also read the Unity documentation, and my searches for "Framework Mono / .NET 3.5", "NET 3.5", "Assembly-CSharp-firstpass" and "mscorlib assembly not found for framework" did not result in any matches. And results for "not installed" and results for "mscorlib" aren't related to this specific issue. I did a lot of experimentation and when I try to enter play mode it says "all compiler errors have to be fixed before" doing that. 

I then uninstalled .NET Framework 4.0 and since the original error says ".NET 3.5 not installed" I decided to install .NET Framework 3.5, and this is what I got: "To run this application, you first must install one of the following versions of the .NET Framework: v4.0" which is the one I had installed in the first place. 

Someone from Unity Cookie crew told me that "this looks like an installation error" so I uninstalled Unity 4.1.0f4, and after that I made sure MonoDevelop (C:\Program Files\Unity\MonoDevelop folder) was completely erased with Shift+Del, (same thing for C:\Program Files\Unity\Editor, and even C:\Documents and Settings\All Users\Documents\Unity Projects\4-0_AngryBots). After that I rebooted. Only then I installed Unity 4.1.2f1, the latest, and I tried again to use scripts that come with Unity, but still got the "Error: Framework 'Mono / .NET 3.5' not installed. (Assembly-CSharp-firstpass)" and "mscorlib assembly not found for framework '.NETFramework,Version=v3.5' The framework may not be installed". I repeated the same process and installed Unity 4.0.1f2. Same errors. Unity 3.5.7. Same errors. And finally Unity 3.0. Same errors.

I don't know exactly how to reproduce the error but maybe using MonoDevelop 2.8.2 on Windows XP SP3 with Microsoft .NET Framework 4 Extended (and Client Profile) installed the error will be reproduced. Maybe not.

Thank you, I look forward to a solution to fix this problem. 
Artist Artis.
Comment 1 Jeffrey Stedfast 2013-03-31 17:52:06 UTC
It loaded mscorlib 4.0, but your project is referencing the 3.5 version which it cannot find.

I'd suggest modifying your project references to use the 4.0 versions of the .NET libraries instead of 3.5.
Comment 2 artistartis 2013-03-31 18:38:06 UTC
Thank you Jeffrey Stedfast for your answer.

I'd like to do what you suggest, so my question would be how do I target version 4.0 of the .NET libraries, how do I modify my project references to use the 4.0 versions of the .NET libraries instead of 3.5?

When I read your answer I did try to do what you said. I experimented opening "Version Control (menu)> Checkout" wich is the only option on Version Control, and it seems to be related to Git Hub. I then opened "Tools> Options", then "Preferences (tab)> .NET Runtimes" and all it lets me do is chose that MonoDevelop runs on Mocrosoft .NET" and it currently is, but nothing about 3.5 to 4.0 version options. Last I opened "Project (menu)> Edit References", thinking this had to be it, it seem to be exactly what you refer to. So on "Project (menu)> Edit References" it opened the "All (tab)" and it has "Assembly-CSharp-firstpass" checked and "Assembly-UnityScript unchecked; on "Packages (tab)" it has nothing; on "Projects (tab)" it has "Assembly-CSharp-firstpass" checked, "Assembly-UnityScript" unchecked and "Assembly-CSharp-Editor" and "Assembly-UnityScript" grayed out; finally on ".NET Assembly" there is the folder of the Project ("4-0_AngryBots"). 

So I couldn't find it myself. I'd like to hear from you how I can modify my project references to use the 4.0 versions of the .NET libraries.

PS.: I also searched on Gooogle for: "project is referencing the 3.5 version" monodevelop; And: project is "referencing the 3.5 version" monodevelop; And finally: "How to reference framework 4.0 dll in project". I didn't find specific directions to what menu to open on MonoDevelop, explaining where those settings are and what settings to change.
Comment 3 artistartis 2013-03-31 18:41:10 UTC
Here is a link for the "Project (menu)> Edit References" tabs that I took screenshots of: http://imgur.com/a/o97L8/embed
Comment 4 Mikayla Hutchinson [MSFT] 2013-03-31 19:34:09 UTC
You are using Unity's modified, very old version of MonoDevelop, which targets a the very old version of Mono (Mono 2.6) used by Unity. Mono 2.6 does not support .NET 4.0.
Comment 5 artistartis 2013-03-31 20:12:33 UTC
Most of us running Unity's MonoDevelop use the latest, .NET 4.5
Comment 6 Mikayla Hutchinson [MSFT] 2013-04-01 00:38:15 UTC
Mono only supports .NET 4.5 in the Mono 3.x betas which I don't believe Unity is using. MonoDevelop 2.8.x certainly doesn't support .NET 4.5 - we only added .NET 4.5 support in MonoDevelop 4.0 (i.e.  Xamarin Studio).

The last published information I can find from Unity is that Unity 4.x uses Mono 2.6: http://web.archive.org/web/20121101210417/http://unity3d.com/unity/4/faq

Note that Mono 2.6 did not support .NET 4.0 features. Mono previewed .NET 4.0 support in Mono 2.8 and fully stabilized it in Mono 2.10. Current Mono stable is 2.10.11. The last Mono 2.6.x release was 2.6.7, released on July 19, 2010.

Regardless, I'm pretty confident your problem has something to do with the way Unity integrates its custom Mono version with its custom version of MonoDevelop..
Comment 7 artistartis 2013-04-01 11:31:41 UTC
Oh, I mean that most of Unity users are running .NET 4.5, otherwise everyone would have had compatibility problems and the default would be downgrading to .NET 2.0, so my problem would be easy to fix.

Based on the results on Google and the replies on the Unity forum I'm the first ever to have this problem, and except for one guy that said he was having it too, nobody else is. 

I opened the link you shared, and then the link "Read more at..." http://tinyurl.com/Unity-s-Mono-Compatibility and there is a list where the MonoDevelop for Unity is only compatible with .NET 2.0, but does that mean that everyone who uses Unity 4 is downgrading to .NET 2.0? Not at all. If everyone was used to installing .NET 2.0 in order to use Unity 4's MonoDevelop it would be very simple to fix my problem, but what happens is that nobody knows how to fix it.

Since the error says ".NET 3.5 not installed" I did install .NET Framework 3.5, that surprisingly to me already comes with .NET 1.0 and .NET 2.0 so should work with MonoDevelop 2.8.2, right? No, because with .NET 2.0 installed Unity's MonoDevelop 2.8.2 asks: "To run this application, you first must install one of the following versions of the .NET Framework: v4.0". That's v4.0, not v2.0.

Anyways, this here is RESOLVED, so the only thing I can think of is to go with alternatives to MonoDevelop: like Notepad++, UniSciTE, etc.
Comment 8 Mikayla Hutchinson [MSFT] 2013-04-01 15:37:03 UTC
The Mono runtime is an open-source reimplementation of the .NET runtime, i.e. an app that is built for .NET can run on Mono and vice versa (with caveats which I won't get into here). There isn't a 1:1 version compatibility, for example Mono 2.6 supports most of the .NET 3.5 features. But in the Unity webplayer, Unity removed the .NET 3.5 features from Mono to save space, so Unity apps built for the web player can only use .NET 2.0 features.

Mono has the advantage that it's more flexible and runs on more operating systems, so Unity uses the Mono runtime, not .NET. When you see references to .NET versions in Unity docs it's referring to the .NET features supported by Unity's customized version of Mono. it's not referring to the MS .NET runtime.

MD itself runs on the MS .NET 4.5 runtime on Windows, but it can target (i.e. build against, run app on) other runtimes e.g. Mono, Unity Mono. In this case it seems to be having trouble with the customized Mono runtime that Unity is shipping.
Comment 9 artistartis 2013-04-01 16:33:00 UTC
Unity seems proud to be the one that builds and runs to more platforms than their competitors, but this fact that you pointed out that they "removed the .NET 3.5 features from Mono to save space", so "Unity apps built for the web player can only use .NET 2.0 features" shows that they are going for quantity, not quality.

PS.:
Unity: 
Web, PC, Mac, Linux, Google Native Client, iOS, Android, Xbox 360, Mac, PS3, Flash and Wii .: (12 platforms)

UDK: 
iOS, Win, Flash, Android, Xbox 360, Mac, PS3, PSVita and Wii U .: (9 platforms)

CryENGINE: 
Xbox 360, PS3 and PC .: (3 platforms)