gpt4 book ai didi

asp.net - 元素 'system.webServer' 具有无效的子元素 'httpPlatform'

转载 作者:行者123 更新时间:2023-12-04 11:35:50 24 4
gpt4 key购买 nike

我正在学习 Shawn Wildermuth 的类(class) here并在我构建时收到有关 web.config 的以下警告

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 是
<?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>

程序运行正常。我应该对警告做些什么吗?

最佳答案

直到当前写入时间(2016 年 1 月),这是 MS 未修复的已知问题。它可能会在以后的版本/更新中修复。

问题是缺少 httpPlatform 元素:

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

您可以使用具有管理员权限的编辑器手动修改 xsd,并将其添加到 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>

这为我解决了这个问题。

更新:您可以找到类似的帖子 here .我在那里得到了最初的想法,但稍微修改了架构。

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

关于asp.net - 元素 'system.webServer' 具有无效的子元素 'httpPlatform',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34245066/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com