【发布时间】:2016-12-16 01:31:27
【问题描述】:
我正在 Windows Server 2008 R2 上配置 IIS 7.0 以运行新的 .net Core 框架,但出现此错误:
无法读取配置节“aspNetCore”,因为它缺少节声明
是否需要实施某种设置才能让此类网站运行? 使用了应用程序池标识。
web.config 使用来自 VS 2015 社区的这个标签自动编写脚本。
编译发布后的配置如下:
<?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="dotnet" arguments=".\HUBS.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 6f683ac9-2a86-4206-b3fe-8d5705488733-->
【问题讨论】:
-
你是否在服务器上安装了服务器运行时?
-
您是否确保运行您的应用程序的应用程序池配置为使用 .NET 4,而不是 .NET 2?
标签: .net asp.net-core .net-core