Running .NET program in linux

1.2k views Asked by At

I have a C# project that uses another C++ project (.NET c++) as a dll. I have the source code for all of those. I want to run the program on Linux. Is there a way to do that (to run .NET code on Linux) or do I have to manually translate the program to C or Java so it can be run on Linux?

Thanks

P.S I found the following article (https://www.cyberciti.biz/faq/howto-compile-and-run-c-cplusplus-code-in-linux/) that just says i can compile C++ apps on Linux. So to everybody who says C++ can't be run on Linux, i would like a clarification please. (Because as i said - i DO have the source code, so can i just compile the program to run on Linux?)

1

There are 1 answers

10
Ben Voigt On

Unless the ".NET C++" portion (I presume you actually mean C++/CLI, since Managed C++ Extensions for .NET is abandoned over a decade ago) is compiled with /clr:pure, there will be some porting required.

Pure MSIL assemblies, such as are created by the C# compiler, can execute directly on Linux with the help of Mono.

There is a new .NET runtime for Linux directly from Microsoft, the .NET Core, but it is focused on web services. If you have a console application, .NET Core might be sufficient, but since it lacks any of the GUI frameworks, most likely you will still need to use Mono.