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, please Reply
|