Using IIS to host ASP. NET Core2.0 on Windows

Source: Internet
Author: User

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

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.