How can I use Web.debug.config in the built-in visual studio debugger server?

前端 未结 7 664
花落未央
花落未央 2020-11-27 02:34

How can I merge and make use of Web.debug.config in visual studio 2010 built-in debugger?

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 03:23

    After reading many similar posts and having problems with files not being able to be overwritten or web.config not being accessible because it is read only this is what I got working for me:

      
        
          
          
        
        
        
        
      
    

    Notes:

    This runs as the BeforeBuild target.

    I only want it to run under a certain configuration (an alternative debug environment) and so that is why I have the Condition. When deploying via web deploy the publishing target kicks in and I don't need this target to run.

    I don't want to have to remember to check out web.config (only to undo it when I am done) so I check web.config out before beginning the transform. If you aren't using TFS you can remove this line.

    Because VS (2010) \ msbuild doesn't want to let go of the Source web.config I use a temp file (thanks to this article for the info: http://www.diaryofaninja.com/blog/2011/09/14/using-custom-webconfig-transformations-in-msbuild)

    I tried adding a command to delete the TempWeb.config but VS \ msbuild doesn't want to let go of it. I can live with it as it doesn't get added to TFS.

提交回复
热议问题