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

View: 39849|Reply: 2

[Source] CentOS 7 installs the runtime environment with ASP.NET Core 3.1

[Copy link]
Posted on 2021-9-21 15:11:19 | | | |
Since the project was previously developed using ASP.NET Core 2.0, Microsoft is no longer maintaining and supporting the 2.0 version of .NET Core, and the project has been upgraded to version 3.1. Introduce:The hyperlink login is visible.
Review:

Centos 7 installation. NET Core SDK tutorial
https://www.itsvse.com/thread-4860-1-1.html

Centos 7 .Net core background daemon supervisor tutorial
https://www.itsvse.com/thread-4870-1-1.html

Run .net core console program on Linux/Centos [source code]
https://www.itsvse.com/thread-3703-1-1.html

How do I install the ASP.NET Core 3.1 runtime environment on CentOS 7?



Add a Microsoft source

Before you install .NET, run the following command to add the Microsoft package signing key to the trusted key list and add the Microsoft package repository. Open Terminal and run the following command:



Since I have already installed it before, I can see the microsoft-prod.repo file under the /etc/yum.repos.d/ directory, as follows:

name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/rhel/7/prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

Install the SDK

The .NET SDK enables you to develop apps through .NET. If you install the .NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following command:


dotnet-sdk-3.1 will include the following dependencies:

aspnetcore-runtime-3.1.x86_64 0:3.1.19-1       aspnetcore-targeting-pack-3.1.x86_64 0:3.1.10-1      dotnet-apphost-pack-3.1.x86_64 0:3.1.19-1            dotnet-hostfxr-3.1.x86_64 0:3.1.19-1      dotnet-runtime-3.1.x86_64 0:3.1.19-1     
  dotnet-runtime-deps-3.1.x86_64 0:3.1.19-1      dotnet-targeting-pack-3.1.x86_64 0:3.1.0-1           netstandard-targeting-pack-2.1.x86_64 0:2.1.0-1  

In factIf the server only deploys ASP.NET Core applications, it does not need to install the SDK, but only the runtime, taking aspnetcore-runtime-3.1 as an example, the command is as follows:


Release and deployment

Package asp.net Core 3.1 as a release version, upload it to the server, and start it with the following command:


Using curl to access the interface test, since my default page is the input ok string, the test works, as shown in the figure below:



(End)






Previous:Windows uses cwRsync (Rsync) to synchronize two disk files
Next:Under CentOS 7, Kafka often hangs up solutions
Posted on 2021-9-22 19:51:59 |
Come and take a look and learn more
 Landlord| Posted on 2021-10-17 12:08:43 |
CentOS 8 installation commands

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