This article is a mirror article of machine translation, please click here to jump to the original article.

View: 52334|Reply: 4

[.NET Core] Run .net core console program on Linux/Centos [source code]

[Copy link]
Posted on 5/17/2017 3:11:43 PM | | | |

No nonsense, let me show you a screenshot of the successful operation on Linux/CentOS!

The steps are as follows:

1: Make sure that Visual Studio is generating a release of your application. If necessary, change the build configuration settings on the toolbar from Debug to Release, as shown in the following image.


2: Right-click on the XXX project (not the XXX solution) and select Publish from the menu. You can also select Publish XXX in the Build Visual Studio main menu.
When you see the Publish dialog box shown in the following image, select Create New Profile to create a new publishing profile.




3: In the Select Publishing Target dialog box as shown in the figure above, select the OK button to publish the application to the local file system. The program will be located in the bin\release\PublishOutput subdirectory of the application project directory

4: At this point, you have created a publish profile, select the Publish button in the Publish dialog box, as shown in the image below.


The published output includes the following three files that make up the application and can be deployed by copying these files to the target system:
MyFirstNetCore.dll
MyFirstNetCore.deps.json
MyFirstNetCore.runtimeconfig.json
runtimes folder
The fourth file, MyFirstNetCore.pdb, contains the debug symbols. There is no need to distribute this file with the application, although it should be saved in cases where the release version of the application needs to be debugged.
The runtimes folder is the dll package that the program needs

5: Upload to Linux/centos system, I won't talk about the specific method last time.

6: Execution:

We can see the image effect at the top of the article!!!. The net core console program successfully runs in the Linux/CentOS environment!


Finally, attach the release package and source code! As follows:

Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:.NET Core console Chinese character garbled characters
Next:Detailed explanation of various parameters of HTTP protocol
Posted on 6/22/2020 4:57:37 PM |
2 yuan flower... value
Posted on 6/26/2020 2:52:03 AM |
This must be learned
Posted on 8/4/2021 4:34:52 PM |
11111111111111111111111111111111
Posted on 2/27/2022 7:04:33 PM |
Thank you, boss!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com