{"id":2834,"date":"2010-11-10T21:53:00","date_gmt":"2010-11-10T21:53:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2010\/11\/10\/asp-net-web-application-publishpackage-tokenizing-parameters\/"},"modified":"2010-11-10T21:53:00","modified_gmt":"2010-11-10T21:53:00","slug":"asp-net-web-application-publishpackage-tokenizing-parameters","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/asp-net-web-application-publishpackage-tokenizing-parameters\/","title":{"rendered":"ASP.NET Web Application: Publish\/Package Tokenizing Parameters"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Today I just saw a question posted on stackoverflow.com asking <a href=\"http:\/\/stackoverflow.com\/q\/4151325\/105999\" target=\"_blank\" rel=\"noopener\">Why are some Web.config transforms tokenised into SetParameters.xml and others are not<\/a>? Let me give some background on this topic for those who are not aware of what the question is.<\/p>\n<p>With Visual Studio 2010 when you package your application using the Build Deployment Package context menu option, see image below.<\/p>\n<p><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2010\/11\/6371.BuildDeployPackage.png\" \/><\/p>\n<p>When build the package by default the package will be created in obj{Configuration}Package{ProjectName}.zip where {Configuration} is the current build configuration, and {ProjectName} is the name of the project. So in this case I since I&rsquo;m building with Debug and the project name is MvcApplication1 the package will be placed at <strong>objDebugPackageMvcApplication1.zip<\/strong>. If you take this package and then import into IIS 7 with the &ldquo;Import Application&rdquo; option shown below. Note: The machine must have the <a href=\"http:\/\/www.iis.net\/download\/WebDeploy\" target=\"_blank\" rel=\"noopener\">Web Deployment Tool<\/a> (aka MSDeploy) installed.<\/p>\n<p><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2010\/11\/2860.ImportApp.png\" \/><\/p>\n<p>Once you click on Import Application then browse out to the package you will be shown a screen which prompts your for parameters. Its shown below.<\/p>\n<p><img decoding=\"async\" border=\"0\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2010\/11\/5224.Iis-Parameters.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>On this screen you can see that we are prompting for a couple parameter values here. One is an IIS setting, Application Path, and the other is a connection string which will be placed inside the web.config file. If your Web Application Project (WAP)&nbsp; had 5 different connection strings then they would automatically show up here on this page. Since connection strings are replaced so often we create parameters for all connection strings by default. You can define new parameters on your own, quite easily actually, but that is the topic for another blog post.<\/p>\n<p>Now back to the question. He is asking why do we &ldquo;tokenize&rdquo; the connection strings in web.config. To clarify take a look at my web.config file below.<\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">configuration<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">appSettings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">add<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">key<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">setting01<\/span>&#8220;<span style=\"color: blue\"> <\/span><span style=\"color: red\">value<\/span><span style=\"color: blue\">=<\/span>&#8220;<span style=\"color: blue\">value01<\/span>&#8220;<span style=\"color: blue\">\/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">appSettings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;font-size: 9.5pt\">&nbsp;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">connectionStrings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">add<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">name<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">ApplicationServices<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">connectionString<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">providerName<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">System.Data.SqlClient<\/span>&#8220;<span style=\"color: blue\"> \/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">connectionStrings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;font-size: 9.5pt\">&nbsp;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">configuration<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><\/p>\n<p>&nbsp;After I perform a package this will get changed. Take a look @ the web.config file which resides in the package (you can get to the file at obj{CofigurationName}PackagePackageTmpweb.config). You will see what is shown below.<\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">configuration<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">appSettings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">add<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">key<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">setting01<\/span>&#8220;<span style=\"color: blue\"> <\/span><span style=\"color: red\">value<\/span><span style=\"color: blue\">=<\/span>&#8220;<span style=\"color: blue\">value01<\/span>&#8220;<span style=\"color: blue\">\/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">appSettings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">connectionStrings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">add<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">name<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">ApplicationServices<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">connectionString<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">$(ReplacableToken_ApplicationServices-Web.config Connection String_0)<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">providerName<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">System.Data.SqlClient<\/span>&#8220;<span style=\"color: blue\"> \/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">connectionStrings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;font-size: 9.5pt\">&nbsp;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">configuration<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><\/p>\n<p>So his question is why is the connection string replaced with $(ReplacableToken_ApplicationServices-Web.config Connection String_0) and nothing else is? We do this because we do not want you to accidently copy your web to a location and have it executing SQL statements against a SQL server which you did not intend. The idea is that you will create a package that you can deploy to many different environments. So the value that was in your web.config (or web.debug.config\/web.release.config if you are using a <a href=\"http:\/\/blogs.msdn.com\/b\/webdevtools\/archive\/2009\/05\/04\/web-deployment-web-config-transformation.aspx?wa=wsignin1.0\" target=\"_blank\" rel=\"noopener\"><strong><span style=\"color: #696969\">web.config transformation<\/span><\/strong><\/a>) will not be placed inside the web.config in the package. Instead those values will be used as defaults in the package itself. We also create a SetParameters.xml file for you so that you can tweak the values. For my app see the MvcApplication1.SetParameters.xml file below.<\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;?<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">xml<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">version<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">1.0<\/span>&#8220;<span style=\"color: blue\"> <\/span><span style=\"color: red\">encoding<\/span><span style=\"color: blue\">=<\/span>&#8220;<span style=\"color: blue\">utf-8<\/span>&#8220;<span style=\"color: blue\">?&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">parameters<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">setParameter<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">name<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">IIS Web Application Name<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">value<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">Default Web Site\/MvcApplication1_deploy<\/span>&#8220;<span style=\"color: blue\"> \/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">setParameter<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">name<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">ApplicationServices-Web.config Connection String<\/span>&#8220;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">value<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true<\/span>&#8220;<span style=\"color: blue\"> \/&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">parameters<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p>The idea is that you can deploy your package in 2 ways. Through the IIS Manager which will prompt you for the parameters or you can deploy using msdeploy.exe with the &ndash;setParamFile switch to specify the path to the SetParameters.xml file. In this case I could create a QA01.SetParameters.xml file along with a QA02.SetParameters.xml file to deploy my web to my two QA servers. How do we do this?<\/p>\n<h3>&nbsp;How connection strings are tokenized<\/h3>\n<p>&nbsp;You might be wondering how the connection strings are tokenized to begin with. With Visual Studio 2010 we released web.config transformations, which all you to write terse web.config transformations inside of files like web.debug.config\/web.release.config. When you package\/publish your web these transform files are used to transform your web.config based on what you expressed in the appropriate transform file. We have an MSBuild task TransformXml which performs the transformation. We use that same task to tokenize the connection strings. If you are interested in the details take a look at %ProgramFiles32%MSBuildMicrosoftVisualStudiov10.0WebMicrosoft.Web.Publishing.targets in the <strong>AutoParameterizationWebConfigConnectionStringsCore<\/strong> target.<\/p>\n<p>Now what if you do not want the connection string tokenized?<\/p>\n<h3>Prevent tokenizing connection strings<\/h3>\n<p>If you want to prevent your web.config connection strings from being tokenized it&rsquo;s pretty easy. All we need to do is the add a property to the build\/package\/publish process. We can do that in 2 ways. Edit the project file itself or create a file with the name {ProjectName}.wpp.targets where {ProjectName} is the name of your project. The second approach is easier so I use that. In my case it would be MvcApplication1.wpp.targets. The contents of the file are shown below.<\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;?<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">xml<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">version<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">1.0<\/span>&#8220;<span style=\"color: blue\"> <\/span><span style=\"color: red\">encoding<\/span><span style=\"color: blue\">=<\/span>&#8220;<span style=\"color: blue\">utf-8<\/span>&#8220;<span style=\"color: blue\">?&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">Project<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"> <\/span><span style=\"font-family: Consolas;color: red;font-size: 9.5pt\">xmlns<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">=<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">&#8220;<span style=\"color: blue\">http:\/\/schemas.microsoft.com\/developer\/msbuild\/2003<\/span>&#8220;<span style=\"color: blue\">&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;font-size: 9.5pt\">&nbsp;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">PropertyGroup<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">AutoParameterizationWebConfigConnectionStrings<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\">false<span style=\"color: blue\">&lt;\/<\/span><span style=\"color: #a31515\">AutoParameterizationWebConfigConnectionStrings<\/span><span style=\"color: blue\">&gt;<\/span><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\"><span>&nbsp; <\/span>&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">PropertyGroup<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><span style=\"font-family: Consolas;font-size: 9.5pt\"><\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;font-size: 9.5pt\">&nbsp;<\/span><\/p>\n<p style=\"line-height: normal;margin: 0in 0in 0pt\" class=\"MsoNormal\"><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&lt;\/<\/span><span style=\"font-family: Consolas;color: #a31515;font-size: 9.5pt\">Project<\/span><span style=\"font-family: Consolas;color: blue;font-size: 9.5pt\">&gt;<\/span><\/p>\n<p><strong><span style=\"text-decoration: underline\">Note: You may need to reload the project in Visual Studio for this to take effect.<\/span><\/strong><\/p>\n<p>Inside of this file I have declared the property, AutoParameterizationWebConfigConnectionStrings, to be false. This is telling the Web Publishing Pipeline (WPP) that it should not replace replace the connection strings with tokens, instead leave them as they are.<\/p>\n<p>Questions\/Comments???<\/p>\n<h4>Other Resources<\/h4>\n<ul>\n<li><a href=\"http:\/\/sedodream.com\/2010\/04\/26\/ConfigTransformationsOutsideOfWebAppBuilds.aspx\"><strong><span style=\"color: #696969\">Config transformations outside of web app builds<\/span><\/strong><\/a> <\/li>\n<li><a href=\"http:\/\/sedodream.com\/2010\/09\/09\/ExtendingXMLWebconfigConfigTransformation.aspx\"><strong><span style=\"color: #696969\">Extending XML (web.config) Config transformation<\/span><\/strong><\/a> <\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: left;text-indent: 0px;letter-spacing: normal;border-collapse: separate;font: 14px 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;color: #333333\"><span style=\"line-height: 18px;font-size: 12px\">Sayed Ibrahim Hashimi &#8211;<span>&nbsp;<\/span><a style=\"color: #0066dd;cursor: pointer;font-weight: normal;text-decoration: none\" href=\"https:\/\/twitter.com\/sayedihashimi\"><strong><span style=\"color: #696969\">@sayedihashimi<\/span><\/strong><\/a><\/span><\/span>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Today I just saw a question posted on stackoverflow.com asking Why are some Web.config transforms tokenised into SetParameters.xml and others are not? Let me give some background on this topic for those who are not aware of what the question is. With Visual Studio 2010 when you package your application using the Build Deployment [&hellip;]<\/p>\n","protected":false},"author":404,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[31,7347,7336,7263,7371,7324,7363,7264,7329,7282,7340],"class_list":["post-2834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-asp-net","tag-asp-net-4","tag-msdeploy","tag-pm","tag-sayed-ibrahim-hashimi","tag-vs10","tag-vs2010","tag-wap","tag-web-deployment","tag-web-config","tag-web-config-transformation"],"acf":[],"blog_post_summary":"<p>&nbsp; Today I just saw a question posted on stackoverflow.com asking Why are some Web.config transforms tokenised into SetParameters.xml and others are not? Let me give some background on this topic for those who are not aware of what the question is. With Visual Studio 2010 when you package your application using the Build Deployment [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/404"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=2834"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2834\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=2834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=2834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=2834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}