to let. NET applications run on Linux, it is common practice to install mono on Linux and run the program with the "Mono your.exe" command.
This approach to running. NET programs has two weaknesses, one that requires the client to install mono, and two is the "Mono xx.exe" command line that always feels a bit unprofessional.
Well, there is no way to neither install mono, but also to let you. NET program is like the C language compiled program so, "direct" running on Linux?
In order to solve the simplicity of the. NET program, especially the. NET console program deployment and operation on the Linux platform, I have prepared a small tool called "anyexec", the following specifically how to integrate your. NET program with Anyexec, Form a program system that can run independently on a Linux platform without the need to install mono.
One, prepare:
1, because there are only 64-bit anyexec, so we need to prepare a 64-bit Linux testing machine.
2, download anyexec. Run the command on the Linux test machine: wget http://linuxdot.net/down/anyexec-1.1-linux_x64.tar.gz
3, unzip. Run decompression command: TAR-ZXVF anyexec-1.1-linux_x64.tar.gz
4, the extracted, the shape of "anyexec-1.1-linux_x64" such as the name of the folder you need to change the name, such as Myprog. The command is MV Anyexec-1.1-linux_x64 Myprog.
Then enter Myprog, with the LS command can see a program file called any and three folders named app, Lib and bin respectively.
You can try to run any, and if you see the following information, it means that anyexec can work properly on your system.
Second, Integration:
1, prepare a. NET console program. If not, you can create a new one, for example, I use VS to create a console file called Myprog. NET version Select 4.0 or 4.5.
The content is:
Then compile the exe file.
2, upload the exe file to the Anyexec folder (that is, you have renamed the Myprog folder) under the name "app" sub-folder.
3. Rename the executable name "any" so that the new file name matches the exe file name you uploaded to the app folder (without the extension), such as: Myprog
4, Trial run:
Now you can try running this Linux program that once called "any" and now has the same name as your program (for example, Myprog).
Three, Packaging release:
With the above steps, your program has been integrated with anyexec as a self-contained. NET runtime, and is named standalone by your program, and the client does not need to install a program system that mono can run properly. Now, you just need to make the entire folder into a compressed package, you can give it to the customer. As to how you publish, how to give customers, how to let customers learn to decompress and run, hehe, this is certainly not my business!
These are all steps to using Anyexec. Well, with anyexec, running. NET applications on Linux is not hard at all!
Do not install mono, your. NET program can still run on Linux!