VS2010 When debugging web.config transforms are not being applied. Building a deployment package works

六眼飞鱼酱① 提交于 2019-12-23 07:39:31

问题


When I debug a web application, the web.config transforms are not applied. I simply find that the configuration in web.config is not applying the transform for the configuration I'm currently using.

Yet if I build a deployment package then I find that the web.config does have the current transforms applied.

Are transforms not applied when debugging? I'm starting to wonder if this is the case, but I have coworkers insisting that it works for them.


回答1:


Web.config transforms are only applied when publishing or deploying.

Jared Harding provided a link where a member of the .NET Team answered this question in the response here: VS2010 Clean Web.configs - not updating

The link he provided for ease of reference is: http://forums.asp.net/p/1532038/3711423.aspx




回答2:


You can start a transform by introducing a "AfterBuild" entry in your project file as described here. Downside: you have 2 web.config files...

http://kfigy.blogspot.ch/2010/03/making-visual-studio-2010-webconfig.html



来源:https://stackoverflow.com/questions/6300205/vs2010-when-debugging-web-config-transforms-are-not-being-applied-building-a-de

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!