2015-12-12 32 views
7

我通过肖恩Wildermuth的课程here工作,得到如下的警告有关的web.config当我建立元素“system.webServer具有无效子元素“httpPlatform”

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> 

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

+0

这是一个[已知问题](https://connect.microsoft.com/VisualStudio/Feedback/Details/1906736),如果它不是显示屏,我会忽略它。 – ourmandave

回答

1

首先,这个过程现在已经很老了(RC2即将到来),所以你将不得不放弃,并等待看看是否会有更新的课程。

[更新:对于RC2及以上,一个新的模块是必需的,而不是HttpPlatformHandler,https://github.com/aspnet/Announcements/issues/164]

+0

我下载了HttpPlatformHandler_1.exe,但是当我运行它时,Web Platform Installer 5.0会提示“Microsoft Web Platform Installer找不到您尝试安装的产品,或者您点击的链接不正确,或者您可能正在重写Feed使用不同的Feed“ –

+0

MSI下载链接位于底部,https://www.iis.net/downloads/microsoft/httpplatformhandler –

+0

我运行了MSI,但仍然出现错误。 –

7

直到当前写入的时间(一月至2016),这是一个已知的问题,MS没固定。它可能会在更高版本/更新中修复。

的问题是,httpPlatform元素缺少来自:

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

您可以manualy修改与编辑器中的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"> 并将其置于其上方。

+1

将它添加到这行上面

+1

Dzivo,它不一定要超出元素:处理程序,只要它在里面元素:system.webServer!但是,确定这是一个很好的建议,以帮助找到现场!我现在更新答案..请upvote如果它为你工作;-) – cnom

+0

不必须,但对于不知道该把它放在哪里的人来说更容易 –

相关问题