元素"system.webServer"具有无效的子元素"aspNetCore" [英] The element 'system.webServer' has invalid child element 'aspNetCore'

查看:148
本文介绍了元素"system.webServer"具有无效的子元素"aspNetCore"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

严重性代码描述项目文件行抑制状态
警告元素"system.webServer"具有无效的子元素"aspNetCore".预期的可能元素列表:'asp,缓存,cgi,defaultDocument,directoryBrowse,globalModules,处理程序,httpCompression,webSocket,httpErrors,httpLogging,httpProtocol,httpRedirect,httpTracing,isapiFilters,模块,applicationInitialization,odbcLogging,安全性,serverRuntime,serverSideInclude,staticContent ,跟踪,urlCompression,验证,管理,重写".

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>

如何消除警告?

推荐答案

安装 .NET Core用于Visual Studio 2015的工具预览2 .

您可以从 .NET下载页面下载它

如果它已经安装并且不起作用,则可以尝试进行修复:转到程序和功能,选择 Microsoft .NET Core 1.0.1-VS 2015 Tooling Preview 2 ,单击更改,然后进行修复.

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.

这篇关于元素"system.webServer"具有无效的子元素"aspNetCore"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆