james antrobus

@james_antrobus

Web.Config transformations injecting ‘ReplacableToken’ for connection string

leave a comment »

Oh MSBuild, you so crazy. By default MSBuild will not replace connection strings when running Web.Config transformations. The thinking behind this is that if you miss a replacement value out of a Debug config you can’t deploy to a dev server with a release connection string in your Web.Config (from a previous transformation, I guess).

Personally I don’t think this makes sense anyway, but oh well. MSBuild will drop your actual connection string into a SetParameters.xml file in your obj\{Config}\Package directory. You can force MSBuild to transform connection strings through a (massive) MSBuild parameter.

At the command line:
msbuild MyApp.sln /p:AutoParameterizationWebConfigConnectionStrings=false

 

More at StackOverflow

Written by James Antrobus

August 19, 2011 at 9:48 pm

Posted in .net

Tagged with , , ,

Leave a comment