Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm new to Mono. I want to develop a Windows.Forms application on Windows under Visual Studio but execute on Linux. From the Mono documentation it’s not clear to me: 1) Should I reference Mono version of Winforms dlls or Microsoft .NET version? 2) Should I compile with dmcs or Microsoft csc.exe? What are the differences between these two compilers?
Posted

In theory, anything that works in "true" .NET will work exactly the same in Mono.

:laugh::laugh::laugh::laugh::laugh:

I practice, most of it will. Some of it will work pretty closely, some will fail completely, and some isn't implemented at all.

Provided you stick to .NET 2.0 most of mono will work like a charm - when I have had problems is has been running mono on Linux for a website, I've not tried it for Winforms.

If you can target for mono under windows, rather than using the "true" .NET framework then you will get a better idea of what will and won't work immediately, rather than when you next transfer your EXE to the Linux box and try to run it. Never tried that, and don't know how well VS will work.

Sound negative? It is a bit, but it reflects my experiences. Very successful for the most part, but deeply frustrating when code works fine on "true" .NET then fails under Mono and you spend ages trying to work out what went wrong.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Apr-11 15:06pm    
Griff, My 5, but I have somewhat more positive view and also explain standardization, please see.
--SA
OriginalGriff 17-Apr-11 2:50am    
Hi SA! My view is coloured by the differences I had to work round with Mono for websites :laugh:
Eventually, I decided to say "enough is enough" and switched hosting to "true" .NET - much easier in the long run. V3.5 may be a lot better, but I suspect many of the subtle differences which made it a PITA with V2.0 are still there, buried and waiting... :)
You get my 5, though
Sergey Alexandrovich Kryukov 17-Apr-11 11:34am    
Thank you, Griff.
Your experience is interesting to me. As you mentioned Web sites and hosting, is my guess right: you tried to program Web site using mod_mono for Apache? I never tried it but wanted to know: how's that? So, that bad, does not worth trying? Would be pity.
I run on Mono some my applications, console and Forms (would like to have WPF very much), it was problematic in the past, but I don't have problems these days.
Thank you.
--SA
OriginalGriff 18-Apr-11 3:12am    
No, straight mono hosted on Linux webserver with MySql, just written in C# and the usual HTML in a VS Website project. Sorry - I never tried Apache!
Sergey Alexandrovich Kryukov 18-Apr-11 3:16am    
And what did you use for a Web Server on Linux if not Apache? And how bad is all that if you complain?
(What I was thinking about is "straight" Mono (pun unintended) anyway, plus Apache, plus an Apache module mod_mono which actually implements APS.NET for Apache; I hopes it would be a popular Web host setting, but actually don't know much from others' experience and never had either time or other resources to try myself, as I practically don't do Web development of general purpose.)
--SA
The compilers are different: one it Microsoft proprietary, another on is Open Source Mono.
You can develop on .NET and run without recompilation on Mono.
You need to check Mono documentation for compatibility: http://www.mono-project.com/Compatibility[^].

Main idea is: CLI is the matter of standardization in ECMA and ISO. See http://www.ecma-international.org/publications/standards/Ecma-335.htm[^]. In particular, the standard defines standard parts of the .NET library.
The standard part of library should be compatible between .NET and Mono, please good deal of non-standard libraries, including System.Windows.Forms. I personally develop .NET Forms applications which run on Mono right away. I try to do it very accurately, trying to identify potential portability problem from the very beginning and basically satisfied with the compatibility. It was not so good before .NET v.3.5, but right now I do not have complains.

—SA
 
Share this answer
 
Comments
Albin Abel 16-Apr-11 15:37pm    
Good answer
Sergey Alexandrovich Kryukov 16-Apr-11 15:46pm    
Thank you, Albin.
--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