asp.net - 嵌套 web.config 转换

标签 asp.net visual-studio-2010

我有一个带有简单 web.config 的子目录

<configuration>
  <system.web>
    <!--<authorization>
      <allow roles="admin"/>
      <deny users="*"/>
    </authorization>-->
  </system.web>
</configuration>

我喜欢在开发过程中关闭安全性。我喜欢快速部署 - Alt-B-H

问题:我可以使用我的主 web.release.config 来取消评论吗?

最佳答案

您无法通过配置转换删除注释。但是,您可以删除整个授权元素及其所有子元素。

尝试将以下内容放入 Web.Debug.config 中:

<configuration>
  <system.web>
    <authorization xdt:Transform="Remove"/>
  </system.web>
</configuration>

关于asp.net - 嵌套 web.config 转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4999834/

相关文章:

asp.net - 在 .NET 项目中的何处复制引用的程序集?

c# - ToString() 格式不起作用

asp.net - 为什么 ASP.Net 重写 runat=server anchor 控件的相对路径?

c# - IIS7 中的 ASP.NET 站点无响应

asp.net - web.config 转换为 microsoft.identitymodel 配置部分

c++ - Visual Studio 2010 项目中引用的库

c# - 如何获取 HtmlGenericControl 的属性值?

c# - 阻止 Visual Studio 在 switch-case 语句中添加换行符

visual-studio-2010 - 如何在 Visual Studio 2010 的 cshtml 文件中设置断点?

visual-studio-2010 - 是否可以从 Visual Studio 2010 Team Explorer 连接到多个 TFS 服务器