Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can mono run framework.net compiled applications (from a VS env)

Tags:

c#

.net

vb.net

mono

I read many questions on running .net code with mono but i always end up with the same question. I'm building a new app right now, so i better start straight and take the good direction:

Can i develop an app within Visual C# Express or Visual Basic Express, compile it from the Microsoft environment using the compilers they have and run that application using MONO on linux.

Or do i have to work with the mono compiler from scratch (or convert my MS project afterwards to mono) to be able to use my .net apps using the Mono framework on linux.

Linux/Mac support is not really a must for my app development, but i'd like to get it straight off the start.

Thanks


Regarding the apis:

i'm using WinForms, Encryption, Globalization, SQLClient but thats probably all, is there anything you Mono experts out can tell me NOT to use off the start.

Oh and i use the My namespace for all sorts of things such as getting the computer name, logged on user name, resources, settings, etc...

like image 439
Mathieu Dumoulin Avatar asked Nov 30 '11 19:11

Mathieu Dumoulin


People also ask

Can mono run .NET framework?

Yes, Mono can run applications developed with the Microsoft . NET Framework on UNIX.

Can mono run .NET Core?

NET Core, which natively only allows you to build console apps and web applications, mono allows you to build many application types available in . NET Framework, including GUI-enabled desktop apps. So, if mono can do everything that . NET Core can while .

Does .NET 5 use mono?

NET 5 launches in November 2020, it will produce two runtimes: CoreCLR and mono. CoreCLR will extend . NET Core 3 to encompass the features of . NET Framework and mono; mono will continue to exist so developers can choose to target either it or CoreCLR.


2 Answers

Generally yes, that works.

The issue isn't recompiling, it's the available native APIs and libraries. If you add native interop, the library you work with must be available on Linux too, which obviously isn't the case for the windows libraries.

Certain managed libraries aren't available at all(WPF), or are incomplete (WCF).

Mono has a WinForms implementation, but it looks foreign, since it doesn't use native controls. This means the code will work on other platforms, but the user experience won't be nice.

like image 94
CodesInChaos Avatar answered Sep 30 '22 06:09

CodesInChaos


All compilers for .Net languages compile to standard MSIL, which can be executed by any compliant implementation, including Mono.

However, some assemblies included with Microsoft.Net and Visual Studio are not available for Mono on non-Windows platforms.

like image 41
SLaks Avatar answered Sep 30 '22 05:09

SLaks