Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've read that Mono is an implementation of the .Net Framework for platforms other than Windows. Hence, it should allow you to use the same library and stuff.

What is the point then of installing Mono in Windows?
Isn't the code developed for other platforms perfectly compatible with .Net, and hence I should be able to copy-paste it to Visual studio and then compile?

Thank you!
Posted

It is really important to install Mono on Windows, in many cases. It depends on what do you expect from Mono. One of such cases is when you want to do the CLI development, and develop code in more then one platform, including Windows, with Windows being your primary development platform.

In principle, you could do it using only .NET on Windows (with Visual Studio or not), test it on Window, and then test it on some other platform(s). You don't need to recompile your assemblies made on Windows. Ideally, it can work and often words. In real cases, it may cause problems. The reason is simple: Mono is not 100% compatible; and it is not even supposed to be 100% compatible, even though the compatibility if very good in many cases. For example, WPF and other parts of .NET FCL were never developed for Mono. BCL is supposed to be fully compatible, as well as a number of some non-standard parts of FCL, such as System.Windows.Forms (yes, these assemblies are not part of the ECMA standard for the environment). However, there are some incompatible pieces, especially in FCL which is not part of BCL. I even remember one case where people reported a bit of .NET behavior as a bug, which was fixed in Mono, which is a kind of incompatibility (;-)). And I saw some implementation bugs in Mono, which I did not find in .NET, so I had to apply some work-around solutions.

Due to these incompatibilities, one of the effective methods of work on Windows would be using both .NET and Mono. The two runtime environments are fully isolated, because you run applications in different ways:
:: for .NET for Windows:
someApplication.exe

:: for Mono on all platforms:
mono someApplication.exe

Here is what you can do: develop some code on Windows, test it on .NET for Windows, and then re-test it on Mono for Windows. After this last step, the behavior of your code on Mono for Windows will be maximally close to the expected behavior on Mono on other platforms, but only if other products your product depends on are also installed on both platforms, in the same or compatible versions.

—SA
 
Share this answer
 
v3
That's the theory, yes - and by and large it's true.

But...I have tried to develop code to run a website under linux / mono with .NET on Windows as the development environment, and it was an exercise in pure frustration. What worked fine in development failed nastily and badly when ported to the release web host. OK, that was a couple of years back, and the situation may well have improved lots, and it may have been using some of the "less common" .NET framework, but it was bad enough that I abandoned the web host (despite being perfect in all other ways) and moved to my current host which runs Windows and .NET on it's servers.

Perhaps if I had installed Mono on my development machine I would not have got so frustrated - I don't know. And maybe now, Mono is fully compatible and I wouldn't have any such problems. But my time is valuable enough to me to say "Elephant it!" and not touch mono again unless I really, really have to.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Mar-14 15:45pm    
I think you have misrepresented the quality of Mono, or at least expressed biased opinion. It was no so frustrating in the past, and I would not say you would not have any problems at all. My last Mono project was not long time ago, I did have problems. At the same time, I created a number of compatible assemblies long time ago, when .NET v.3.5 was just introduced; and I would say Mono worked reasonably well even then.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900