Ramon Torras


ASP.NET Web Deployment with Visual Studio 2013

This post applies from.NET framework 4.0 onwards.

That way to automatize the deployment came with Visual Studio 2012 and now Visual Studio 2013 follows the same pattern.

We can deploy a project using the “Publish” option in Visual Studio as we can see in the screenshot.

Deployment scenarios

Publish from Visual Studio

When we want to deploy directly from Visual Studio. You will need to specify all the parameters of the IIS.

NOTE: Using this profile, Visual studio UI will deploy the project automatically on the IIS web site.

Web deployment package

In this case, we want generate Deployment package but we will install the packet after manually.

That will generate a web deployment package is a .zip file that contains all the information needed for deployment. Later on, you will install it on the destination server by using the command line or IIS Manager. One reason could be, because I don’t have access to the server so I would need to provide all the files to the administrator and he will deploy them.

It could be another better reason, your enterprise implements Continuous integration (CI) and you need to automatize the deployment of the same packet with scripts.

The application is promoted through testing and staging environments before it is deployed to production.

As we can see in the following diagram, the first deployment from the Dev Machine to his Test Server could be using Visual Studio or deploying the package manually. The second way could be with a “Source Control” Let’s suppose TFS 2013 with Release Management which will be in charge of deploying the application in all the stages (Test, QA, Pre and Pro)

How we can deploy the same package to different environments? What happen with the configurations?

We will need to sort out different issues:

  • Configure web.config transformations
  • Specify which files and folders should be copied to the destination server
  • Set folder permissions on the destination server
  • Install certificates on the server
  • Create a Rollback plan

In the next posts I will try to describe all of them.

References: http://msdn.microsoft.com/en-us/library/dd394698(v=vs.110).aspx

, ,