ASP.NET MVC 5 - Deployment On Windows IIS Server

Introduction 

 
Deployment is a mandatory next step after the development of your product. Depend on your application type and technology used; you will package your product accordingly for commercial use. For ASP.NET MVC platforms, you need a windows server with IIS manager installed in order to deploy your web application. You can also package your web application in the Docker environment and then deploy your docker package on any server machine that satisfies the hardware requirement for your web application. Note that Docker is independent of local OS environment.
 
Today, I shall be demonstrating deployment of any ASP.NET MVC5 application on Windows machine with IIS server installed. 
 
 
Prerequisites
 
Following are some prerequisites before you proceed any further in this tutorial:
  1. Enable/Install Microsoft Web Deploy & IIS Server.
You can also watch this video tutorial to deploy ASP.NET MVC5 web application on a Windows machine with IIS server installed.
 
 
Let's begin now.
 
Step 1
 
Right-click on your ASP.NET MVC5 application inside Visual Studio and then click "Publish".
 
 
Step 2
 
Now, select the "IIS" option from the left menu and click "Create Profile" button.
 
 
Step 3
 
Change your publish method to "Web Deploy Package" and provide your package location, then click "Next".
 
 
Step 4
 
Click "Save" on the next screen.
 
 
Step 5 
 
Now, click "Publish" on the publish screen.



You can see your web application deployment package stored as ".zip" file on your target location.
 
 
Step 6
 
Now, search for "Internet Information Services (IIS) Manager" on your machine and then click it.
 
 
Step 7
 
Right-click on "Application Pool" and then click "Add Application Pool".
 
 
Step 8
 
Type your application pool name and configure the settings, as shown below, and then click "OK".
 
 
You will see that your application pool has been created and started.
 
 
Step 9
 
Now, right-click on "Sites" and then click "Add Website".
 
 
Step 10
 
On "Add Website" window, first select the application pool that you have created specifically for your ASP.NET MVC5 web application, click "Select" button, then choose your application pool and then click "OK" as shown below i.e.
 
 
 
Step 11
 
Now, provide configuration settings on "Add Website" screen and then click "OK" as shown below:
 
 
You can see that your empty website is being created on the server as shown below:
 
 
Step 12
 
Right click on "Test" site then click "Deploy->Import Application" as shown below:
 
 
Step 13
 
On the "Select Package" screen, provide the location path of your published ".zip" web application file and then click "Next" as shown below i.e.
 
 
Step 14 
 
On the next screen, select all the options and then click "Next" as shown below:
 

Step 15

Click "Next" on the next screen as shown below:
 

Step 16

Click "Finish" button, your web application has been deployed successfully as shown below:
 
 
 
Step 17
 
You need to purchase & configure your custom domain name on server, in order to access your web application from web browser using a custom url address. To configure a custom domain name free of cost on your local windows machine for custom url address access, follow the steps provided at the end of the video tutorial, link to the video tutorial is provided above in this article. Therefore, after your custom url address configuration, type your url address in the browser and you will be able to access your ASP.NET MVC5 web application, which has been successfully deployed on windows IIS server i.e.
 
 

Conclusion

 
In this article, you learned to deploy your ASP.NET MVC5 web application on a Windows machine with IIS server installed. You learned to publish your ASP.NET MVC5 application as a web deployed ZIP package. You also learned to add a new application pool on your IIS server and finally, you learned to add a new website on your IIS server with a custom domain name url address.


Similar Articles