In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to make .NET programs run on Linux without mono. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The current common practice for .NET applications to run on linux is to install mono on Linux and then run the program with the "mono your.exe" command.
This approach to running. Net programs has two weaknesses, one is that the client is required to install mono, and the other is "mono xx.exe", which is always a bit unprofessional on the command line.
So, is there a way to run your .NET program "directly" on Linux, just like a program compiled in c, without installing mono?
In order to solve the problem of easy deployment and operation of .net programs, especially .net console programs on the Linux platform, I have prepared a gadget called "AnyExec". Let's talk about how to integrate your .net programs with AnyExec to form a program system that can run independently on the Linux platform without installing mono.
First, prepare:
1. Since there is only 64-bit AnyExec at present, 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, decompression. Run the extract command: tar-zxvf anyexec-1.1-linux_x64.tar.gz
4. Change the unzipped folder name such as "anyexec-1.1-linux_x64" to the name you need, such as myprog. The command is mv anyexec-1.1-linux_x64 myprog.
Then go to myprog and use the ls command to see a program file called any and three folders named app, lib, and bin, respectively.
You can try to run any. If you see the following message, AnyExec will work 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, and the .NET version is 4.0 or 4.5.
Then compile the exe file.
2. Upload the exe file to a subfolder called "app" under the anyexec folder (that is, you have renamed it to the myprog folder).
3. Rename the executable file named "any" so that the new file name is the same as the exe file name you uploaded to the app folder (without extension), such as myprog
Now, you can try to run the linux program that was once called "any" and now has the same name as your program (such as myprog).
Third, package and release:
Through the above steps, your program has been integrated with anyexec into a self-contained. Net runtime, and named after your program, the client does not need to install mono to run properly. Now, you just need to make the entire folder into a package, and you can give it to the customer. As for how you release, how to give to the customer, how to let the customer learn to decompress and run, ha ha, this is definitely not my business!
The above content is how to make .NET programs run on Linux without mono. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.