开发者

Is it possible to perform Web.config transformations without publishing?

I am using VS2010, and I understand that when I publish a web application, the Web.config I am using 开发者_运维知识库is transformed based on the build settings.

i.e. When I choose Debug, it uses my development SQL server, and when I choose Release, it uses my production SQL server.

What I want to know is: Can I, using only the built in Visual Studio Development Server, select "Release" from the Configuration drop-down, and then the green "Continue" arrow (F5), and run using the transformed Web.config settings?

I would be quite happy having another file such as "generic.config" (or better: "Web.Generic.config"), which holds the master code if necessary.


I don't believe there's a simple way to do this. I would have thought it's unusual to want to run code locally against a production database, but maybe you're not in Enterprise Land which is probably what this functionality was designed for.

An alternative would be to publish your site to a server, and then use Remote Debugging to step into the code.

The plain web.config is your local and generic settings combined. The transforms tweak the generic data to match the environment you're deploying to.

There's a handy site if you just want to quickly test the results of a web.config transform: http://webconfigtransformationtester.apphb.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜