18

I created a new ASP.NET Core MVC 6 application from one of the templates in Visual Studio 2015.

The tutorial I'm looking at says to modify the web.config file. When I open that file, Visual Studio throws the warning:

Severity Code Description Project File Line Suppression State
Warning The element 'system.webServer' has invalid child element 'aspNetCore'. 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'.

Here is the virgin web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->

  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

How do I eliminate the warning?

  • 2
    Looks like the schema for web.config is not up-to-date - have you installed preview1 tooling? Also, you should not need to change web.config manually. Rather you should have the publish-iis script configured as a postpublish script which will tweak the config for you when you publish your application. If you want more details check my post about running ASP.Net Core apps with IIS - https://blog.3d-logic.com/2016/06/08/running-asp-net-core-applications-with-iis-and-antares/ – Pawel Jun 21 '16 at 13:54
  • did you find a way to solve this? i am having the same problem – Luis Palacios Jul 06 '16 at 16:34
  • @LuisPalacios, unfortunately, there are known issues in this release. See this link: https://github.com/aspnet/Tooling/blob/master/known-issues.md#missing-sdk –  Jul 06 '16 at 18:56
  • Try updating Visual Studio 2015: https://www.microsoft.com/net/core#windows –  Jul 06 '16 at 18:57
  • To me opening Visual Studio as Administrator didn't solve the "warning underscore", but made the process start on IIS Express. – Francesco Bonizzi Dec 12 '16 at 11:21

3 Answers3

3

Install .NET Core Tooling Preview 2 for Visual Studio 2015.

You can download it from the .NET Downloads page

If it's already installed and it doesn't work you can try doing a repair: Go to Programs and Features, select Microsoft .NET Core 1.0.1 - VS 2015 Tooling Preview 2, click change, and then repair.

Stephen Oberauer
  • 5,237
  • 6
  • 53
  • 75
  • This doesn't help. Every time I build the application Visual Studio oversrites web.config to change it to read arguments = %LAUNCHER_ARGS%. The aspNetCore elemnt is valid until I change arguments back to the name of my application dll. Then the tag becomes invalid again. I have repaired the tools installation 3 times. – pthalacker Aug 06 '16 at 19:40
  • @pthalacker - Sorry about that. I thought that it worked for me when I repaired mine. Unfortunately I cannot delete my answer, because it has been accepted. – Stephen Oberauer Aug 07 '16 at 12:20
1

Same problem here, I solved running VS2016 "as administrator". Right click on the VS2016 executable, click on "Run an Administrator" then load the project

Gianluca Ghettini
  • 11,129
  • 19
  • 93
  • 159
1

Same problem here in VS 2015. I just installed VS 2017 community, and that solved it for me.

ADBF
  • 93
  • 1
  • 15