The element > system.webServer' has invalid child > element 'rewrite'

前端 未结 1 666
甜味超标
甜味超标 2020-12-10 01:51

Warning 1 The element \'system.webServer\' has invalid child element \'rewrite\'. List of possible elements expected: \'asp, caching, cgi, default

相关标签:
1条回答
  • 2020-12-10 02:38

    Possible duplicate of asp.net, url rewrite module and web.config

    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 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/

    For earlier versions download from here: http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/#comment-1402

    For both versions, instructions are here.

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

    For VS2012 and later, follow fftsys's article.

    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.

    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.

    0 讨论(0)
提交回复
热议问题