元素“system.webServer具有无效子元素'改写'。我要解决这个问题,怎么样? [英] Element 'system.webServer' has invalid child element 'rewrite'. Should I fix this, and how?

查看:1023
本文介绍了元素“system.webServer具有无效子元素'改写'。我要解决这个问题,怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多事情,我在IIS7一样,如消除拖尾斜杠,则系综的URL,小写字母,以及这样一些重写规则。 IIS改变了我的web.config,一切工作正常的网站上,像它应该。但在Visual Studio中web.config文件,在打开的<改写> 声明强调了蓝色,在VS的底部,它说,元素 system.webServer具有无效子元素'改写'。但是,这是怎样的IIS使得它...我没有手动完成。我应该关注这个VS错误,或者我应该见好就收的是,因为它的工作应该是如何工作的?

I have a number of rewrite rules for a lot of things that I did in IIS7, like removing trailing slashes, canonnical URLs, lowercase lettering, and such. IIS altered my web.config, and everything works fine on the website, like it should. But in the Visual Studio web.config, the opening <rewrite> statement is underlined in blue, and at the bottom of VS, it says that the element 'system.webServer' has invalid child element 'rewrite'. But this is how IIS made it ... I didn't do this manually. Should I be concerned with this VS error, or should I just leave as be, since it's working how it should work?

下面是我的web.config的例子:

Here's an example of my 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的其他规则,然后结束&LT; /system.webServer>

推荐答案

下面的更新模式固定这对我来说。

The updated schema here fixed this for me.

<一个href=\"http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/\">http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/

请确保您更改脚本VS2010:

Make sure you change the script for VS2010:

ruslany 20 2009年10月在回应7:10 PM#

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

@Gene:这是因为XML架构缓存位于一
  不同的位置在VS2010。你可以打开UpdateSchemaCache.js
  并替换这一行:

@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%
  );

var vs9CommonTools = shell.ExpandEnvironmentStrings( "%VS90COMNTOOLS%" );

这一行:

变种vs9CommonTools = shell.ExpandEnvironmentStrings(
  %VS100COMNTOOLS%);

var vs9CommonTools = shell.ExpandEnvironmentStrings( "%VS100COMNTOOLS%" );

在这之后尝试运行脚本,看看是否有帮助。

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

这篇关于元素“system.webServer具有无效子元素'改写'。我要解决这个问题,怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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