I've been working on a .NET 3.5 C# project using Visual Studio Community 2015, but I had always intended to do most of the development on Linux (Ubuntu Gnome 15.04) using Mono and MonoDevelop.
I'm running the latest stable Mono release (4.0.4) and MonoDevelop (5.9.6), which supports .NET 4.5 and can open the VS created solution file without issue.
Now I've been writing C++ apps on Linux for the best part of a decade, but C# and .NET are completely new to me. So I assumed that if I installed a Mono version that supports .NET 4.5, I would get .NET 3.5 as well because the later version is a superset of the older - much like a C++14 compiler supports C++03.
However this doesn't seem to be the case, as MonoDevelop states (under the Target Framework option for each project):
So do I have to install a parallel older version of Mono in order to get .NET 3.5 support, or am I just suffering a configuration problem?
The easiest way to describe what Mono currently supports is: Everything in . NET 4.7 except WPF, WWF, and with limited WCF and limited ASP.NET async stack.
Yes, Mono can run applications developed with the Microsoft . NET Framework on UNIX.
NET is platform dependent, Mono allows developers to build Linux and cross- platform applications. Mono's . NET implementation is based on the ECMA standards for C#. This paper examines both of these programming environments with the goal of evaluating the performance characteristics of each.
No configuration issue, Mono dropped support for the older frameworks in the 4.x release. If you need to compile against the 3.5 assemblies, then yes, you will need a parallel install.
Dropped Support for Old Frameworks
Reference Assemblies
We no longer build the reference assemblies for the .NET 2.0, .NET 3.5 or .NET 4.0 APIs, we now ship binaries of the reference assemblies (API contracts, without any actual executable code in them).
Mono will now only build the .NET 4.5 assemblies as well as the mobile-based profiles.
Note: You can still run assemblies compiled for earlier .NET profiles on Mono, there’s no need to recompile them (they’ll just run on the .NET 4.5 assemblies instead).
I had a similar issue (project targeting .NET 4.0, but now only 4.5 is available through mono
). My workaround was to create a symlink for 4.0:
On my Fedora 32 machine this was done by
cd /usr/lib/mono
sudo ln -s 4.5 4.0
This is supposed to work because there a (almost) no breaking changes between .NET 4 and 4.5 - YMMV
Finally, Got it to work. I'm using Visual Studio for Mac - https://www.visualstudio.com/vs/visual-studio-mac/
Under Preferences->Projects->.Net Runtimes you can change the Default .Net Runtime. It defaults to Mono 4.8.0.
This is located here on a mac : /Library/Frameworks/Mono.framework/Versions/4.8.0
From here you can download older versions of Mono https://download.mono-project.com/archive/
I downloaded 3.12.1 from https://download.mono-project.com/archive/3.12.1/macos-10-x86/ and copied it into the /Library/Frameworks/Mono.framework/Versions/ folder.
Within VisualStudio you can then add the .net framework and set it as default. My project then compiled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With