How to publish a. NET Core project on the CentOS operating system

Source: Internet
Author: User
Tags dotnet centos server

Environment:
Operating system: CentOS 7
. NET core:2.1.101

Example address of the official website: https://docs.microsoft.com/zh-cn/dotnet/core/linux-prerequisites?tabs=netcore2x

First, under Windows vs 2017 new ASP. NET core Web project, then we can choose two methods to publish the site, one is to use VS and then right-click to publish, one is to use the dotnet Publish command. We upload the generated files to the server:

But there's a problem, my. NET Core test project is written in vs 2017, and the. NET core dependent DLLs under vs are all directly using NuGet to get Microsoft's latest. NET core version and its dependencies.
When we install the Dotnet Core SDK on the CentOS server, we have a problem, because generally this time we are designated dotnet core version, and generally not the latest version, so this time there will be a problem, once the test run will be error:

How to solve? Download the latest version of Dotnet Core and we can find the **deps.json file in our published file to view the version number of our project dependency DLL

How to publish a. NET Core project on the CentOS operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.