用于调试的 VS 2010 Web.config 转换
我是新的 VS 2010 Web.config 转换的粉丝。我将此功能用于部署目的,并想知道是否也可以使用它们进行调试。
我考虑在 IDE 中使用它们:我想创建不同的构建配置(带有链接的转换配置);选择其中之一;在 IDE 中启动网站并以这种方式调试不同的配置。
I’m a fan of the new VS 2010 Web.config transformations. I use this feature for deployment purposes and wondered if it is possible to use them for debugging too.
I think of using them in the IDE: I want to create different built configuration (with linked transformation configurations); choose one of them; start the web site in the IDE and debug the different configurations this way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新
感谢第 3 方插件,SlowCheetah< /a>,现在这是可能的。 Scot Hanselman 有一篇关于此的博客文章。
原始响应:
不幸的是,web.config 转换似乎仅影响发布站点和构建部署包。
在我们的场景中,我们有两个开发组,一个可以访问多个环境(内部),另一个可以访问单个环境(离岸)。有时,内部团队需要直接针对 QA 进行调试,而离岸团队仍处于锁定状态(因此他们的 web.config 必须指向开发环境)。
我们希望每个环境有 1 个构建配置,并且能够选择与要调试的环境相匹配的构建配置——据我所知,这是您的问题。
Update
Thanks to a 3rd party plugin, SlowCheetah, this is now possible. Scot Hanselman has a blog post about it.
Original response:
Unfortunately, the web.config transformations appear to effect only publishing sites and building deployment packages.
In our scenario we have two development groups, one with access to multiple environments (in-house) and the other with access to a single environment (offshore). We have periods where the in-house group needs to debug directly against QA, while offshore remains locked-out (so their web.config's must point to the dev environment).
We were hoping to have 1x build-configuration per-environment, and be able to choose the build-configuration which matched the environment to debug against--which, as I understand it is your question.
如果有人好奇为什么他们没有构建此功能,来自:
http://forums.asp.net/p/1532038/3711423.aspx
“当 Web 应用程序运行时,项目根文件夹下的 web.config 将被 asp.net 拾取,不幸的是,我知道它处于源代码控制之下。我当然理解让运行时使用转换后的 web.config 带来的清洁性来自临时文件夹;但是,asp.net 运行时对 vs projec 结构一无所知,并且它完全基于目录结构,因为子文件夹下的 web.config 可能会继承来自上层的设置。目录级别。”
In case anyone is curious why they haven't built this feature, from:
http://forums.asp.net/p/1532038/3711423.aspx
"When the web app gets run, the web.config under project root folder will be picked up by asp.net and I know unfortunately it is under source control . I certainly understand the cleanness coming with letting runtime use a transformed web.config from a temp folder; however, asp.net runtime doesn't know anything about vs projec structure and it is totaly based on directory structure. Using alternate path might also break as a web.config under a subfolder expect to inherit settings from the upper level of directory."
我找到了一个不涉及任何第三方工具的替代解决方案: http:// /ledtalks.blogspot.in/2011/09/webconfig-transformations-when.html。我只对 web.config 文件尝试过这个
I found an alternative solution that does not involve any third party tool: http://ledtalks.blogspot.in/2011/09/webconfig-transformations-when.html. I only tried this for the web.config file