0

我有一个网络角色 它的 web.config 有以下几行

<system.web>
    <compilation debug="false" targetFramework="4.5.1" />

当我想调试我的角色时,我每次需要将该选项切换到true. 我可以只为调试 web.config 生成吗?debug="true"? 编译时我看到了转换步骤:

Transformed Web.config using C:\data\Main\WebRole\Web.Debug.config into C:\data\Main\obj\x64\Debug\WebRole.csproj\TransformWebConfig\transformed\Web.config.

我可以自定义上述转换吗?为此目的有一个指导http://msdn.microsoft.com/en-us/library/vstudio/dd465318(v=vs.100).aspx但我不确定如何为特定情况编写转换

ve defined the following transformation in the的 Web.Debug.Config`

<system.web>
      <compilation debug="true"
        xdt:Transform="Replace">
      </compilation>
</system.web>

我仍然无法调试并要求手动更改值

4

1 回答 1

-1

从源运行/调试时不使用 web.debug.config:使用 Visual Studio web.config 转换进行调试

使用它更容易设置debug="true"Web.config删除它Web.release.config

示例 Web.Release.Config :

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
  </system.web>
</configuration>
于 2014-12-10T13:46:33.837 回答