. NET core Web site Deployment

Source: Internet
Author: User
Tags dotnet

Deploy to IIS:

Programs developed by 1.net Core can be deployed on IIS

Unlike the ASP. NET era, ASP. NET core is no longer hosted by the IIS worker process (w3wp.exe).
Instead, it runs with a self-hosted Web server (Kestrel).
IIS is the role of the reverse proxy to forward requests to kestrel different ports in the ASP.


No need to set up the application pools hosting our code, it is only responsible for forwarding the request.


Make sure that the Aspnetcoremodule managed module is already installed on your system before deploying

Normal Site Deployment application pool selection unmanaged

. NET core deployed on Ubuntu:


2. Deploy the net Core website to Ubuntu
1. Install the. NET Core SDK

2. Copy the published website to Ubuntu

3.dotnet ***.dll
. dll is the portal connection library generated by the project

4..Net Core created by default after the deployment of the project, can only be accessed within the local, external through the IP is not open,
Can be implemented by configuring Nginx. You can also modify Program.cs by modifying the
var host = new Webhostbuilder ()
. Usekestrel ()
. Useurls ("http://*:5000")
. Usecontentroot (Directory.GetCurrentDirectory ())
. Useiisintegration ()
. Usestartup<startup> ()
. Build ();

Host. Run ();

5. External access to the website via IP

To create a Netcore Web site on windows:

1. Installing the SDK

2. First create a folder mkdir Hwapp,
Then CD Hwapp into the directory,
Finally dotnet new is to create a simple C # program

In fact, two files were created under the newly created Hwapp folder.

Join in the Project.json
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0"
That is, increase the Kestrel HTTP server package as a dependency

3. Run the command dotnet restore
Used to fix specific packages in Project.json


4. Create a Startup.cs program
Create a file named Startup.cs in the Hwapp above
The file is written to the website program

5. Modify Program.cs

6. Execute command dotnet Run,


7. Enter a URL in the address bar to access

. NET core Web site Deployment

Related Article

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.