ReplacableToken_ when using web.config conversion?

I have web.config with 2 conversions - for debugging and release.

web.config:

<connectionStrings> <clear /> <add name="StrName" connectionString="data source=.\sqlexpress;User Id=sa;Password=pass;Database=SocialBot;" providerName="System.Data.SqlClient" /> </connectionStrings> 

I just copied the above example and replaced the name with StrName. I get:

 <add name="StrName" connectionString="$(ReplacableToken_SocialBotConnectionString-Web.config Connection String_0)" providerName="System.Data.SqlClient" /> 

What the hell is a ReplacableToken_?

I have another project and it works without problems.

+62
web-config
02 Sep 2018-10-18T00:
source share
2 answers

If, like me, you encounter this problem while trying to automate the build process using msbuild from the command line, the correct answer can be found in this blog post:

http://www.zvolkov.com/clog/2010/05/18/how-to-packagepublish-web-site-project-using-vs2010-and-msbuild/

In particular, the parameter you must set:

/ p: AutoParameterizationWebConfigConnectionStrings = False

This is most likely what VS does on your behalf when you publish to the file system

+103
Aug 24 2018-11-21T00:
source share

If you want to build using Visual Studio 2010, add the following line to your PropertyGroup configuration in your .csproj:

 <AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings> 

Read more here: How to get rid of "$ (ReplacableToken ...)" in web.config completely

+22
Sep 28 '11 at 16:41
source share



All Articles