我的web.config中有一段如下所示:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="Prerender" type="Prerender.io.PrerenderModule, Prerender.io, Version=1.0.0.2, Culture=neutral, PublicKeyToken=null" />
</modules>
我想摆脱这条线
我已经尝试过了,但除了WebDav之外它已经完全消除了
<system.webServer>
<rewrite xdt:Transform="Replace">
<rules>
</rules>
</rewrite>
<modules runAllManagedModulesForAllRequests="true">
<add name="Prerender" type="Prerender.io.PrerenderModule, Prerender.io, Version=1.0.0.2, Culture=neutral, PublicKeyToken=null"
xdt:Transform="RemoveAll" />
</modules
答案 0 :(得分:2)
您可以使用Refactor->Rename...
和xdt:Transform="Remove"
的组合,如下所示:
xdt:Locator="Match(name)"
在这种情况下,上面将删除按名称匹配的模块<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" xdt:Transform="Remove" xdt:Locator="Match(name)" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="Prerender" type="Prerender.io.PrerenderModule, Prerender.io, Version=1.0.0.2, Culture=neutral, PublicKeyToken=null" />
</modules>
</system.webServer>
。
预览的屏幕截图