How to publish a. net core project on centos, centoscore
Environment:
Operating System: centos 7
. Net core: 2.1.101
Official Website example address: https://docs.microsoft.com/zh-cn/dotnet/core/linux-prerequisites? Tabs = netcore2x
First, create an asp.net core web project in VS 2017 in windows. Then, we can choose two methods to publish the website. One is to use VS and then right-click to publish, and the other is to use the dotnet publish command. Upload the generated file to the server:
But there is a problem, my.. net core test project is written in VS 2017, and in. net core depends on dll are directly used to obtain the latest official Microsoft.. net core version and its dependencies.
The problem occurs when we install the dotnet core SDK on the centos server, because we usually specify the dotnet core version, which is generally not the latest version. Therefore, at this time, there will be problems. Once the test is run, an error will be reported:
How can this problem be solved? Download the latest dotnet core. You can find the ** deps. json file in the released file to view the version number of our project's dependent dll.