WebDeploy Parameterization Tip: Disable automatic ConnectionString parameterization

By default WebDeploy parameterizes all the ConnectionStrings in the web.config for a project.  This always confuses developers when they are first converting over to parameterization from config transforms.

You can open the resulting MSDeploy package zip file and the parameters.xml file to find parameter entries for each of your connections string with the name:

[connection string name]-Web.config Connection String

 

You can use these with no problem but the names are a bit long in my opinion and its odd that some of our parameters are automatically created but others aren’t.  In addition, the ParameterizationPreview VS extension doesn’t take these automatically generated parameters into account.

AutoParameterizationWebConfigConnectionStrings

If this really bothers you don’t dismay, you can disable this behavior by creating a [projectname].wpp.targets file and adding the following MSBuild property:

<autoparameterizationwebconfigconnectionstrings>false</autoparameterizationwebconfigconnectionstrings> 

Or you can pass the property as an MSBuild argument:

/p:autoparameterizationwebconfigconnectionstrings=false

2 thoughts on “WebDeploy Parameterization Tip: Disable automatic ConnectionString parameterization”

  1. Pingback: The Anatomy of a WebDeploy Package – dotnet Catch

  2. Pingback: The Anatomy of a WebDeploy Package – dotnet catch

Leave a Reply