How to deploy ASP.NET Web Application to IIS

In this article, we will show you how to host our ASP.NET MVC 5 Web Application in IIS.


- Create a new ASP.NET Web Application named Test


DeployAppToIIS_1.PNG

The next step is to host in IIS Windows Server. For that use the following instructions.


- In your Solution Explorer, select your project and right-click to select Publish.


DeployAppToIIS_2.PNG

- Select the Custom option as a publish target in the Profile menu


DeployAppToIIS_3.PNG

- Name the profile as TestPublish in the New Custom Profile dialog.


- Select the File System option in Publish Method and select your preferred location in Target location. Click Next.


DeployAppToIIS_4.PNG

- Select Release in the Configuration section in the Settings menu and click Next.


DeployAppToIIS_5.PNG

- Click the Publish button


You will see that the application will publish successfully.


DeployAppToIIS_6.PNG

IIS Host


- Go to the C:\inetpub\wwwroot directory and create a folder named TestApp


- Copy the files of the published project to the TestApp folder


DeployAppToIIS_7.PNG

DeployAppToIIS_8.PNG

- Open the Internet Information Services (IIS) Manager


DeployAppToIIS_9.PNG

- Select the project( TestApp ) in the Default Web Site.


DeployAppToIIS_10.PNG

- Right-click the project and select the "Convert to Application" option


DeployAppToIIS_11.PNG

- Click OK in the Add Application wizard.


DeployAppToIIS_12.PNG

- Ensure that your DefaultAppPool Site Status is "Started" in Application Pools.


DeployAppToIIS_13.PNG

- Right-click your project and select Manage Application > Browse


DeployAppToIIS_14.PNG

- You will see an output as shown below.


DeployAppToIIS_15.PNG

If you get an error such as "This operation requires IIS integrated pipeline mode." in your browser, for that do the following instructions


- Select "Advanced Settings" of your DefaultAppPool Site in the Application Pool by right-clicking.


DeployAppToIIS_16.PNG

- Select "Integrated" in the Managed Pipeline Mode.


DeployAppToIIS_17.PNG

- Reload your browser and you will see the Home Page.


That's it.