Often on a new project, I want to publish directly from Visual Studio into Azure using a web deploy. When I'm performing a web deployment from Visual Studio, I frequently bump into issues that are caused by missing release targets for the web.config files within the project. Lets us say we are doing a deploy using release as the release target. If a release version of a web.config does not exist Visual Studio complains, e.g. web.config.relase.

These issues are not a result of the websites main web.config file, I'm talking about the other ones. The 'web.config' files that get installed by third-party Umbraco packages. Most packages are installed within of App_Plugins and you will likely see these transform errors resulting from this folder. Packages, where I have experienced this issue, include, Articulate and LeBlender. I have even had this issue with some of the Umbraco install files. For example, after installing the plug-ins mentioned above, these additional web.config files will be added to your project:

  • App_Plugins\Articulate\Views\Web.config
  • App_Plugins\LeBlender\Web.config
  • umbraco\Install\Views\Web.config

Having to create a release version for each of these is a chore. The build will break each time you add a new package. The good news is that preventing these issues from happening is really simple. In this tutorial, I will show you exactly how to configure your Visual Studio to make these types of deployments easier 😊

Auto-parameterization

When Visual Studio does a web deployment, by default it uses something called auto-parameterization to perform transforms on all config files defined in your solution. The most common configuration everyone uses is the 'release'. transform When auto-parameterization occurs Visual Studio looks for all the web.config files within your project, it will then will attempt to apply environment specific transformations onto them. If you do not have a specific release version of a config file, e.g. web.release.config, Visual Studio will not know how to apply auto-parameterization on it and will fail the deployment 😢

To fix this issue you can update your [projectname].wpp.targets file. Either add - or if it's already there, update - the following config:

After saving your change, it's best to close your solution down and re-open. Now when you try to publish it should go through without any complaints, enjoy!