【ASP.NET Core】在CentOS上安装.NET Core运行时、部署到CentOS

时间:2021-11-22 19:23:21

第一步:Add the dotnet product feed

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'

第二步:Install the .NET SDK

sudo yum update
sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.0.2

第二步:创建项目

1.  dotnet new webapi -n myWeb
2. cd helloCore
3. dotnet run