我可以在不使用 Visual Studio 2012 发布的情况下使用 Web Config Transform 吗?

我可以在不使用 Visual Studio 2012 发布的情况下使用 Web Config Transform 吗?

问题描述:

Visual Studio 2012 是否支持在不需要发布的情况下运行使用特定 Web.config 转换的解决方案?我们正在使用 web.config 更改发布时的客户端设置,并希望在本地测试它们.

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.

web.config 转换功能仅在发布/打包期间可用.

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

解决这个问题的原因是,Web 项目没有抽象的替代文件夹,应用程序在其中执行,而不是像 win 项目那样具有源所在的文件夹.正因为如此,很多 VS 代码都涉及到源 web.config.如果在 VS 不知道的情况下修改 web.config 文件本身可能会导致奇怪的行为.

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.

我在 http://sedodream.com/2010/10/21 上写了如何手动执行此操作的博客/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx.

有很多人要求使用此功能,即使它可能会使他们的 Web 项目处于潜在的不良状态.由于需求如此之高,我正在考虑在 SlowCheetah 中添加一个手势,该手势也将为 Web 项目启用此功能.我在 https://github.com/sayedihashimi/slow-cheetah/的 SlowCheetah 项目页面上遇到了一个问题问题/39 来跟踪这个.您可以关注该问题以获取进一步更新.这可能是我接下来要处理的项目之一,但与此同时,您可以使用上面链接中的说明.

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.