The element 'system.webServer' has an invalid child element 'httpPlatform'

I work through the Sean Wildermouth course here and get the following warning about web.config when creating

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> 

The program is working fine. Do I have to do anything with a warning?

+7
source share
2 answers

Until the text is written (January-2016), this is a known issue that MS has not fixed. It will probably be fixed in a later version / update.

The problem is that the httpPlatform element is missing:

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

You can manually change xsd with an editor that has administrator privileges and add it 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> 

This solved the problem for me.

UPDATE: you can find a similar message here . I got the original idea, but changed the scheme a bit.

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

+7
source

Firstly, this course is already quite old (RC2 is suitable), so you have to abandon it, and wait if a new course appears.

[Updated: for RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]

+1
source

All Articles