I have a program in C sharp, can I compile it as an executable file for a Linux server so that I can run it on the server without installing mono?

Possible duplicate:
How to convert a simple .Net-console project into portable exe using Mono and mkbundle?

I have a C # program that was written on windows, I need to transfer it to the linux server.
However, the client does not want to install mono on its server, so I want to find a way to simplify it.
Is it possible to convert this program to a format that will work on linux without mono installed there?

+3
source share
2 answers

You need to use mkbundle with the --static option if your target system is not set to mono.

Bundles additionally support the -static flag. The -static flag causes mkbundle to generate a static executable that statically links Mono runtime. Keep in mind that this option will trigger LGPL's requirement that you continue to distribute independent instances to your user so that he can manually update his Mono runtime if he wants to.

+6
source

C # programs are based on the standard Common Language runtime. They are not native applications. So, as far as I know, there is no way to run a program made in C # without the presence of CLR in the system. Currently there are only two of them: .NET (Windows) and Mono.

Therefore, I do not think that there is a way to run your program on a non-Windows machine without installing Mono.

+6
source

Source: https://habr.com/ru/post/1395464/


All Articles