元素'system.webServer'具有无效的子元素'aspNetCore'如何解决?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (54)

我从Visual Studio 2015中的一个模板创建了一个新的ASP.NET Core MVC 6应用程序。

我正在看的教程说修改web.config文件。当我打开该文件时,Visual Studio会引发警告:

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'.

这是web.config文件:

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

我如何消除警告?

提问于
用户回答回答于
用户回答回答于

同样的问题,我解决了以管理员身份运行VS2016。右键点击VS2016可执行文件,点击“运行管理员”,然后加载项目

扫码关注云+社区

领取腾讯云代金券