What are good rules of thumb when writing cross-platform applications in C #?

I did not need to write cross-platform applications in C # yet. However, every time I start working with paths, etc., I always wonder what I should do to make my life easier if I need to cross-compile Mono.

I understand that a GUI can be a problem. I would like to try using good cross-platform techniques in my regular Windows coding, if possible.

Are any ADO issues addressed?

What problems do people have and how are they solved?

+6
c # cross-platform
source share
3 answers

Run everything through MOMA after you write it. It identifies for you any designs that are not platform independent or are not implemented in the Mono runtime.

Additional compilation with both MSBuild and the mon.net compiler.

Using Path.Combine and Environment.NewLine is a pair from the head.

Avoid creating only windows (WMI, etc.) that have no linux / unix counterpart.

+4
source share

Path.Combine to mind.

Guidelines: Application_Portability may be useful

+1
source share

If you create your application using Mono in a Windows environment using Gtk # , then it should work on all platforms, since it will not be used by any of the .NET libraries that are not available in Mono, and will not use any of the Mono / libraries Gtk # which are not supported on Windows.

If you are a Visual Studio user, take a look at the Mono Tools for VS package.

+1
source share

All Articles