元素 >system.webServer' 有无效的孩子 >元素“重写" [英] The element > system.webServer' has invalid child > element 'rewrite'

查看:16
本文介绍了元素 >system.webServer' 有无效的孩子 >元素“重写"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告 1 元素'system.webServer' 有无效的孩子元素重写".可能的清单预期元素:'asp、缓存、cgi、默认文档,目录浏览,全局模块、处理程序、httpCompression、httpErrors、httpLogging, httpProtocol,http重定向、http跟踪、isapiFilters,模块,odbcLogging,安全性,服务器运行时,服务器端包含,静态内容,跟踪,urlCompression,验证,管理'.D:PROJEKTIFoodOrderFoodOrderWeb.config 185 4 FoodOrder

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:PROJEKTIFoodOrderFoodOrderWeb.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>

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

page works but i always get warning of this and when i publish page i get publish error becouse of this...

推荐答案

可能与 asp.net、url 重写模块和 web.config

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

This happens when Visual Studio IntelliSense doesn't find information about rewrite module on schema file. Hence we need to add schema for rewrite section in a file specifically: DotNetConfig.xsd

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

Ruslan provides unofficial schema for rewrite. For Visual Studio 2010, please download xml schema from his page: 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

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

For both versions, instructions are here.

对于 VS2010 记得将 %VS90COMNTOOLS% 替换为 %VS100COMNTOOLS%

For VS2010 remember to replace %VS90COMNTOOLS% with %VS100COMNTOOLS%

对于 VS2012 及更高版本,请遵循 fftsys 的文章.

For VS2012 and later, follow fftsys's article.

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

If you do not want to use ruslany's script you can still use rewrite module. In that case, you still can modify web.config to add rewrite section out of visual studio.

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

Original rewrite module for IIS comes from Microsoft: http://www.iis.net/downloads/microsoft/url-rewrite and supported by them. ruslany's script just enables support in Visual Studio so that VS recognizes it.

这篇关于元素 &gt;system.webServer' 有无效的孩子 &gt;元素“重写"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆