加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 元素’system.webServer’有无效的子元素’重写’ 我

发布时间:2020-12-15 18:42:07 所属栏目:asp.Net 来源:网络整理
导读:我在IIS7中有很多重写规则,比如删除尾部的斜杠,标点的URL,小写字母等等。 IIS改变了我的web.config,一切都在网站上运行正常,就像它应该的一样。但是在Visual Studio web.config中,打开 rewrite语句以蓝色加下划线,在VS的底部,它表示元素“system.web
我在IIS7中有很多重写规则,比如删除尾部的斜杠,标点的URL,小写字母等等。 IIS改变了我的web.config,一切都在网站上运行正常,就像它应该的一样。但是在Visual Studio web.config中,打开< rewrite>语句以蓝色加下划线,在VS的底部,它表示元素“system.webServer”具有无效的子元素“重写”。但这是IIS如何做…我没有手动这样做。我应该关心这个VS错误,还是应该像现在一样离开,因为它是如何工作的?

以下是我的web.config示例:

<system.webServer>
    <rewrite>         <-------------------- this is underlined in squiggly blue
        <rules>
            <rule name="RemoveASPX" enabled="true" stopProcessing="true">
                <match url="(.*).aspx" />
                <action type="Redirect" url="{R:1}" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{URL}" pattern="(.*)/default.aspx" negate="true" />
                    <add input="{URL}" pattern="(.*)/admin/*" negate="true" />
                    <add input="{URL}" pattern="(.*)/desktopmodules/*" negate="true" />
                </conditions>
            </rule>

约有5或6个其他规则,然后关闭< /system.webServeru0026gt;最后。

解决方法

这里更新的模式为我解决了这个问题。

http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/

确保更改VS2010的脚本:

ruslany responded on 20 Oct 2009 at 7:10 pm #

@Gene: This is be because the XML schema cache is located in a
different location in VS2010. Can you open the UpdateSchemaCache.js
and replace this line:

var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS90COMNTOOLS%”
);

with this line:

var vs9CommonTools = shell.ExpandEnvironmentStrings(
“%VS100COMNTOOLS%” );

After that try running the script and see if that helps.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读