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
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.
- Select the Custom option as a publish target in the Profile menu
- 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.
- Select Release in the Configuration section in the Settings menu and click Next.
- Click the Publish button
You will see that the application will publish successfully.
- Go to the C:\inetpub\wwwroot directory and create a folder named TestApp
- Copy the files of the published project to the TestApp folder
- Open the Internet Information Services (IIS) Manager
- Select the project( TestApp ) in the Default Web Site.
- Right-click the project and select the "Convert to Application" option
- Click OK in the Add Application wizard.
- Ensure that your DefaultAppPool Site Status is "Started" in Application Pools.
- Right-click your project and select Manage Application > Browse
- You will see an output as shown below.
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.
- Select "Integrated" in the Managed Pipeline Mode.
- Reload your browser and you will see the Home Page.