How to deploy ASP.Net MVC 5 to IIS 8 running Windows Server 2012
If you're deploying to the default web site in IIS you can safely publish to the default website's directory and be up and running.
However, if you're deploying an ASP.NET MVC site to a subdirectory of the default site, or to a new directory on the server, you will need to create a new web site, or convert the subdirectory (when publishing under the default site) to an application.
If this is your first time setting up a site on IIS, Microsoft has documentation on the steps to follow in the learn section of ASP.NET.
Related videos on Youtube
Peter Centellini
Updated on September 18, 2022Comments
-
Peter Centellini over 1 year
I have developed serveral MVC 3, 4, 5 applications and have formerly deployed them via Visual Studio to a hosting provider. Never had a problem with that, everything have always worked. Now I have to deploy a MVC 5 application to a server in the company. I do the same thing as Always in Visual Studio, which means setting up a publishing profile, and then click Publish. The files are copied, and everything gets to the server, but do I not have to do anything in IIS, like Add Website or something? It doesn't work anyway after the VS publishing.
-
Peter Centellini about 9 yearsNo, I'm deploying to its own site. I'm using ftp through Visual Studio.
-
James Skemp about 9 yearsThen you'll need to create a new site in IIS, if you haven't already. The documentation linked to in the answer should help you with that, if needed.