【问题标题】:Solving error "The configuration section 'aspNetCore' cannot be read because it is missing a section declaration"解决错误“无法读取配置节‘aspNetCore’,因为它缺少节声明”
【发布时间】: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


【解决方案1】:

我认为目前无法将 IIS 7.0 (WS 2008 R2) 配置为与 .NET CORE 一起使用。我在 windows server 2012 IIS 8.0 上再次尝试,结果要好得多...

两台服务器中的应用程序池的设置方式相同,但结果不同。应用程序池 .NET CLR 设置为无托管代码、集成管道和 ApplicationPoolIdentity。

ApplicationPoolIdentity 必须具有站点目录的文件权限。 Granting access to IIS 7.5 ApplicationPoolIdentity

也许这会在未来得到解决。 祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-03
    • 2013-01-10
    • 1970-01-01
    • 2011-09-16
    • 2013-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多