[Mono-list] I need a NuGet target for Mono
Edward Ned Harvey (mono)
edward.harvey.mono at clevertrove.com
Thu Aug 4 13:03:25 UTC 2016
> From: mono-list-bounces at lists.dot.net [mailto:mono-list-
> bounces at lists.dot.net] On Behalf Of Tiago Freitas Leal
>
> I know the same assembly is */supposed/* to run on .NET and Mono,
Yes, and no. It's understood that there are differences between Windows .NET and Mono. If you take a DLL that wasn't tested on mono, most likely, it won't work on mono. But if you test your DLL on mono, you can fix it wherever there are differences, and then it will work as desired, cross-platform.
You mentioned Windows.Forms. This is an area where you shouldn't expect it to work. Windows Forms just *barely* works on mono, and doesn't look right, and yields a result that most people don't like anyway (nobody in mac or linux wants windows that look like they're from Microsoft Windows). Plus there's the dependency on X11, which is also undesirable.
To make a cross-platform GUI application, you should have your core code in one cross-platform library, and the GUI code separate. You may use Eto.Forms to make a GUI library that works cross-platform, or you may make the GUI's separate for each platform. Xamarin.Mac for the mac, GTK# or Qt or something for Linux, WinForms or WPF or whatever for Windows.
> 2) I ran a complex non UI library that uses a lot of reflection and the
> application crashed on because of reflection.
Yup. That's testing. Keep it up, and solve those problems, and you'll have a good cross-platform library.
In my experience, about 98% of code works cross-platform on the first try. That means some change will be necessary on one line for every 50 lines of code. Your cross-platform compatibility percentage increases over time, as you become more familiar with what works and what doesn't.
> 3) According to what I read (namely How to target Mono framework from
> VS2015?
> <http://stackoverflow.com/questions/33028966/how-to-target-mono-
> framework-from-vs2015>
> ), there are compatibility issues even for ASP.NET.
>
> So, everything runs? Yes it does, but there is no guarantee it won't crash
> or that it will behave the same way.
A better guide would be the Mono Compatibility Guide.
http://www.mono-project.com/docs/
Under "About Mono" you'll see "Compatibility" and "Class Status". These are the de-facto guides to tell you what works and what doesn't.
More information about the Mono-list
mailing list