Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How cross-platform .Net framework really is?

What is normally to be done to run a WinForms application on a Mac or Linux machine?

a. Just copy and run (assuming they have a Framework installed).
b. Rebuild.
c. Cosmetic source code modifications.
d. Heavy source code modifications and forms redesign.

Assuming that the application is developed as 100% managed C# 3 code by means Visual C# Express or Visual Studio 2008 targeting .Net Framework 3.5, developed without using any 3-rd party components/libraries, without encapsulating nonmanaged code or any low-level hacks - only standard Microsoft-documented .Net Framework C# API used). Or the same conditions but C# 4 language, .Net Framework 4 and Visual Studio 2010.

Is there somewhere a practical guide for developing Mono-ready applications while using MS .Net Framework and Visual Studio? Any guidelines, tips, specific aspect highlights, informing a developer of what he really needs to keep in mind to write an easily portable application without having to lookup every function in the Mono reference while coding in Visual Studio.

like image 575
Ivan Avatar asked May 04 '10 20:05

Ivan


2 Answers

It is possible that your app will just run with zero modifications, but I've yet to see that happen in the real world.

A tool which may help you a great deal is MoMA. MoMA is made by the same folks who make Mono, and will tell you if you are using any features that have not yet been ported.

In general, .NET 3.5 and Winforms is mostly OK. Compatibility with version 4 is still very much in development.

A more up to date tool, if you're doing your development on Windows, is the .NET Portability Analyzer from Microsoft. This can be used via Visual Studio.

like image 192
andypaxo Avatar answered Oct 21 '22 19:10

andypaxo


If it's a Windows Forms application, using standard Windows Forms controls, and no 3rd party components, you can typically run this on Mono directly, just by doing a copy and run.

Mono supports Windows Forms and C# 3 features very well.

However, if you use any native components, data access outside of what is supported by Mono, or WPF, you'll run into issues. C# 4/.NET 4 will most likely not work at this point, either.

like image 41
Reed Copsey Avatar answered Oct 21 '22 18:10

Reed Copsey