gpt4 book ai didi

asp.net - 元素 > system.webServer' 有无效的子元素 > 元素 'rewrite'

转载 作者:行者123 更新时间:2023-12-03 13:28:33 27 4
gpt4 key购买 nike

Warning 1 The element 'system.webServer' has invalid child element 'rewrite'. List of possible elements expected: 'asp, caching, cgi, defaultDocument, directoryBrowse, globalModules, handlers, httpCompression, httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing, isapiFilters, modules, odbcLogging, security, serverRuntime, serverSideInclude, staticContent, tracing, urlCompression, validation, management'. D:\PROJEKTI\FoodOrder\FoodOrder\Web.config 185 4 FoodOrder



代码:
system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
<rewrite>
<rewriteMaps>
<rewriteMap name="StaticRewrites">
<!--<add key="/Default.aspx" value="/Default.aspx" />-->
</rewriteMap>
</rewriteMaps>
<rules>

页面有效,但我总是收到警告,当我发布页面时,我收到发布错误,因为这个......

最佳答案

asp.net, url rewrite module and web.config 的可能重复项

当 Visual Studio IntelliSense 在架构文件上找不到有关重写模块的信息时,就会发生这种情况。因此,我们需要在文件中专门为重写部分添加架构:DotNetConfig.xsd

Ruslan 为重写提供了非官方的模式。对于 Visual Studio 2010,请从他的页面下载 xml 架构:http://ruslany.net/2010/04/visual-studio-xml-intellisense-for-url-rewrite-2-0/

从这里下载早期版本:
http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/#comment-1402

对于这两个版本,说明是 here .

对于 VS2010 记得替换 %VS90COMNTOOLS%%VS100COMNTOOLS%
对于 VS2012 及更高版本,请关注 fftsys's article .

如果您不想使用 ruslany 的脚本,您仍然可以使用 rewrite 模块。在这种情况下,您仍然可以修改 web.config 以在 Visual Studio 之外添加重写部分。

IIS 的原始重写模块来自 Microsoft:http://www.iis.net/downloads/microsoft/url-rewrite并得到他们的支持。 ruslany 的脚本只是在 Visual Studio 中启用支持,以便 VS 识别它。

关于asp.net - 元素 > system.webServer' 有无效的子元素 > 元素 'rewrite',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5309059/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com