Are there any tools that allow you to write (and then run) cross-platform code in C #? If so, which ones?
5 answers
For Linux - Mono. Console programs created in Windows run pretty well with it. Himself dabbled. I did not try it back.
I heard something about C # on iOS.
True, C # programs in lines are rare.
The only one option is very good - use any IDE for development, then under Windows OC you collect natively , under linux - with the help of Mono.
Of course, Mono lags behind in terms of some features of the native C # runtime and, obviously, does not keep up with updates, but the difference is, in general, insignificant. And yes, Mono is a opensource project.
Mono. Even with windows, Mono applications are fairly stable. Even the code in any place was not necessary to be rewritten.
I advise you to read the article and comments to it - Release MonoDevelop 2.8 - integration with XCode 4, support for iOS 5 and more :)
- How do I understand you wrote on WinForms? Or something else? - Nicolas Chabanovsky ♦
- yes, it is WinForms - LinuxFan
- added to my answer, I think will help you assess the advantages and disadvantages - LinuxFan
The problem of .NET is that on all platforms (except Windows, there is the .NET Framework), you will have to install Mono, and it is quite large in size.
By the way, I have programs written in C # that even run on the phone, only when opening files of an error. Even Windows Forms works, only finely everything is inconvenient to use. I have a Maemo OS (this is Linux), Mono is installed.
- And under Makos too Mono? - skegg
- Yes, at least if you believe the page on the link above. - gammaker
Errors when opening files occur when using the Windows-delimited path "\".
There are two ways to overcome this:
- Use "/", as in Unix-systems (Windows digests it without creaking)
- Use
System.IO.Path.DirectorySeparatorChar - Use
Path.Combineto collect paths from directory names