ASP.NET Core WEB deployment: Kestrel

ASP.NET Core WEB deployment: Kestrel, IIS, Docker

Link to this article: https://blog.csdn.net/sundna/article/details/90242777
This article mainly introduces the deployment methods used in the actual release of the project, and the unfinished parts will be gradually improved.

One, use Kestrel to deploy

A WEB server Kestrel is built in ASP.NET Core, which can deploy WEB websites quickly and easily. This method can be used in both Windows system and Linux (CentOS), provided that the .net core operating environment is installed first.

The following describes the deployment method in the Windows system:

1. The default configuration in Program.cs is to use Kestrel to run ASP.NET Core Web

public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
2. 发布文件

 

3. Use the CMD command line to enter the website publishing directory, and then start the website through the .net core runtime

dotnet WebApplication.dll --urls http://0.0.0.0:10001
Description:

The urls parameter can be used to specify the IP and port number bound to the website when it is running. The IP address 0.0.0.0 represents the binding of all internal/external network IPs.

Guess you like

Origin blog.csdn.net/qq_36664772/article/details/113989605