Prepare:
Operating system: Windows Server version R2 or later
Development environment: VS2017
The first step:New Project ASP. NET Core Web application
In Visual Studio, choose File > New > Project.
In the left pane of the New Project dialog box, select. NET CORE,
In the middle pane, click "ASP. NET Core WEB Application"
Modify your project name and storage location
Click OK
In the version selector drop-down box, select "ASP. NET Core 2.0"
Select "Web Application (Model-view-controller)"
Click "OK"
Once created, click "F5" or "ctrl-f5" to see that the program has been successfully run locally, such as:
Step Two: Publish
Right-click the. NET core project to select a publication without modifying the code
Create a new configuration file
Select IIS, click Publish
Drop-Down Select "File System", select the publishing path, click on the next page
Select Configuration, click Save
Step Three: IIS Configuration
In Server Manager, single-machine add role, check IIS, very simple online many tutorials, I do not re-match, IIS installed features default, if necessary, additional tick
Fourth step: Install the. NET Core Managed Bundle (focus)
Note that This step must be performed after the IIS installation, if you perform the fourth step, the third step, the error
Bundles can install the. NET core runtime,. NET core libraries, and ASP. This module creates a reverse proxy between IIS and the Kestrel server.
If your system does not have an Internet connection, first obtain and install Microsoft Visual C + + redistributable before you install the. NET Core managed bundle.
: Https://www.microsoft.com/net/download/all
After the installation is complete, restart the system or execute the net stop was/y and net start w3svc from the command prompt. Restarting IIS selects the Setup program's changes to the system PATH.
Fifth step: Add a Web site to IIS
Note: The application pool is selected without managed code
You are done, click to browse the site
Using IIS to host ASP. NET Core2.0 on Windows