Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

Can I use Web Config Transform without publish with Visual Studio 2012?

Does Visual Studio 2012 support running a solution using a specific Web.config transform without the requirement to publish? We are using the web.config to change client settings on publish and want to test them locally.

question from:https://stackoverflow.com/questions/12177647/can-i-use-web-config-transform-without-publish-with-visual-studio-2012

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The web.config transform feature is only available during publish/package.

The deal with this is that web projects don't have the abstraction of an alternate folder where the app executes versus the folder where the source is located like win project have. Because of this a lot of VS code touches the source web.config. If the web.config file itself if modified without VS knowing it may lead to strange behavior.

I have blogged how you can manually do this at http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx.

There has been a lot of people asking for this feature, even though it may put their web projects into a potentially bad state. Since the demand is soo high I am considering adding a gesture in SlowCheetah that will enable this for web projects as well. I've got an issue on the SlowCheetah project page at https://github.com/sayedihashimi/slow-cheetah/issues/39 to track this. You can follow that issue for further updates. This may be one of the next items that I work on, but in the mean time you can use the instructions at the link above.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...