我的ASP.NET Core应用说无法读取web.config [英] My ASP.NET Core app says it can't read web.config

查看:557
本文介绍了我的ASP.NET Core应用说无法读取web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

访问我发布到本地IIS的应用程序时出现此错误:

I get this error when I access my app which I published to local IIS:

HTTP错误500.19-内部服务器错误 无法访问请求的页面,因为该页面的相关配置数据无效.

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

我的web.config非常简单:

My web.config is really simple:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\TreesOnMars.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 14bfa9ba-0bd6-4ae2-a6f4-6e3e91d35263-->

可能是什么问题?我尝试授予所有用户读取我的c:\inetpub\wwwroot文件夹的权限... web.config中没有任何明显的错误!我在此问题上尝试了一些解决方案问题,但是它们不起作用...

What could be wrong? I tried giving all users permission to read my c:\inetpub\wwwroot folder... the web.config doesn't have any obvious error in it! I tried some of the solutions at this question but they didn't work...

推荐答案

您需要安装.NET Core托管包,才能在IIS中托管.NET Core应用程序.该捆绑软件将安装.NET Core运行时,.NET Core库和ASP.NET Core模块. .NET Core 2.1托管捆绑包的链接在这里: https://www.microsoft.com/net/download/thank-you/dotnet-runtime-2.1.3-windows-hosting-bundle-installer

You need to install the .NET Core hosting bundle to host .NET Core apps in IIS. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The link to the .NET Core 2.1 hosting bundle is here: https://www.microsoft.com/net/download/thank-you/dotnet-runtime-2.1.3-windows-hosting-bundle-installer

还要确保启用了以下Windows功能:

Also make sure the following Windows features are enabled:

更多信息可以在这里找到:

More information can be found here:

查看全文

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