我从Visual Studio2015中的一个模板创建了一个新的ASP.NET Core MVC6应用程序。
我正在看的教程说要修改web.config
文件。当我打开该文件时,Visual Studio抛出警告:
严重性代码说明项目文件行抑制状态
警告元素'system.webServer‘具有无效的子元素'aspNetCore’。应包含的可能元素的列表:“asp、缓存、cgi、defaultDocument、directoryBrowse、globalModules、处理程序、httpCompression、webSocket、httpErrors、httpLogging、httpProtocol、httpRedirect、httpTracing、isapiFilters、模块、applicationInitialization、odbcLogging、安全、serverRuntime、serverSideInclude、staticContent、跟踪、urlCompression、验证、管理、重写”。
以下是原始的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>
如何消除警告?
发布于 2016-07-23 17:29:08
安装.NET Core Tooling Preview 2 for Visual Studio 2015。
你可以从the .NET Downloads page下载
如果它已经安装但不起作用,你可以尝试进行修复:转到程序和功能,选择微软.NET核心1.0.1 - VS 2015工具预览版2,单击更改,然后修复。
发布于 2017-02-16 20:10:17
这里也有同样的问题,我解决了以管理员身份运行VS2016的问题。右键单击VS2016可执行文件,单击"Run an Administrator“,然后加载项目
发布于 2017-03-16 03:36:49
在VS 2015中也存在同样的问题。我刚刚安装了VS 2017社区,这为我解决了这个问题。
https://stackoverflow.com/questions/37945539
复制相似问题