元素"system.webServer"具有无效的子元素"httpPlatform" [英] The element 'system.webServer' has invalid child element 'httpPlatform'

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

问题描述

我正在完成Shawn Wildermuth的课程此处,并在我构建时收到有关web.config的以下警告

I am working through Shawn Wildermuth's course here and get the following warning about web.config when I build

Severity    Code    Description Project File    
Line
Warning     The element 'system.webServer' has invalid child element 'httpPlatform'. 
List of possible elements expected: 'asp, caching, cgi, defaultDocument, 
directoryBrowse, globalModules, handlers, httpCompression, webSocket, 
httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing, 
isapiFilters, modules, applicationInitialization, odbcLogging, security,
serverRuntime, serverSideInclude, staticContent, tracing, urlCompression, 
validation, management, rewrite'.   
TheWorld    E:\EShared\Pluralsight\aspdotnet-5-ef7-bootstrap-angular-web-app\1-aspdotnet-5-ef7-bootstrap-angular-web-app-m1-exercise-files\VS2015\src\TheWorld\wwwroot\web.config   8

Web.config是

Web.config is

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
    </handlers>

    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>

  </system.webServer>
</configuration>

程序运行正常.我应该对警告采取任何措施吗?

The program runs ok. Should I be doing anything about the warning?

推荐答案

直到编写当前文件(2016年1月)为止,这是MS尚未解决的已知问题.可能会在更高的版本/更新中修复该问题.

Up until the time the current is written (Jan-2016) this is a known issue that MS did not fix. It will probably be fixed in a later version/update.

问题是httpPlatform元素从以下位置丢失:

The problem is that the httpPlatform element is missing from:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\1033\DotNetConfig.xsd

您可以使用具有管理员权限的编辑器手动修改xsd,并将其添加到system.webServer下:

You can manualy modify the xsd with an editor having Administrator right and add this under the system.webServer:

    <xs:element name="httpPlatform" vs:help="configuration/system.webServer/httpPlatform">
      <xs:complexType>
        <xs:attribute name="arguments" type="xs:string" use="optional" vs:help="configuration/system.webServer/httpPlatform/arguments" />
        <xs:attribute name="processPath" type="xs:string" use="required" vs:help="configuration/system.webServer/httpPlatform/processPath" />
        <xs:attribute name="startupTimeLimit" use="required" vs:help="configuration/system.webServer/httpPlatform/startupTimeLimit">
          <xs:simpleType>
            <xs:restriction base="xs:int">
              <xs:minInclusive value="1" />
              <xs:maxInclusive value="99999" />
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="stdoutLogEnabled" type="small_boolean_Type" use="required" vs:help="configuration/system.webServer/httpPlatform/stdoutLogEnabled" />
        <xs:attribute name="stdoutLogFile" type="xs:string" vs:help="configuration/system.webServer/httpPlatform/stdoutLogFile" />
        <xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict" />
      </xs:complexType>
    </xs:element>

这为我解决了问题.

更新:您可以在此处找到类似的帖子.我在那里得到了最初的想法,但是对模式进行了一些修改.

UPDATE: you can find a similar post here. I got the original idea there, but modified the schema a bit.

UPDATE2:提示找到要添加元素的点的位置< xs:element name ="handlers" vs:help ="configuration/system.webServer/handlers"> 并将它放在上面.

UPDATE2: a hint to find the spot to add the element is to locate <xs:element name="handlers" vs:help="configuration/system.webServer/handlers"> and place it just above it.

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

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