HTTP错误500.31-无法加载ASP.NET Core运行时 [英] HTTP Error 500.31 - Failed to load ASP.NET Core runtime

查看:1411
本文介绍了HTTP错误500.31-无法加载ASP.NET Core运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 10计算机上将.NET Core应用程序部署到IIS时遇到问题.

I'm having issues deploying .NET Core applications to IIS on a Windows 10 machine.

当我部署到IIS并导航到该站点时,会收到以下消息:

When I deploy to IIS and navigate to the site I recieve the message:

"HTTP Error 500.31 - Failed to load ASP.NET Core runtime
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526

在我的事件查看器中,对该页面的每次调用都会产生3条错误消息.

In my event viewer, every call to the page generates 3 error messages.

无法找到应用程序依赖项.确保已安装应用程序针对的Microsoft.NetCore.App和Microsoft.AspNetCore.App的版本.

Unable to locate application dependencies. Ensure that the versions of Microsoft.NetCore.App and Microsoft.AspNetCore.App targeted by the application are installed.

  • 找不到"aspnetcorev2_inprocess.dll".异常消息:

    Could not find 'aspnetcorev2_inprocess.dll'. Exception message:

  • 无法启动应用程序'/LM/W3SVC/4/ROOT',错误代码'0x8000ffff'.

    Failed to start application '/LM/W3SVC/4/ROOT', ErrorCode '0x8000ffff'.

  • 仅就这些而言,我会无所适从,以为在项目的构建或安装某些.NET Core软件包时存在一些问题,除了:

    On these alone, I'd go down the rabbit hole of thinking there's some issue in the build of the project or perhaps my installation of some .NET Core package except:

    1. 我还有另外两个在不同端口上运行的.NET Core 3.1站点.实际上,如果我将文件从工作站点的目录复制到非工作站点的目录,则它们将不会通过IIS运行.如果我将文件从非工作站点的目录复制到工作站点,则这些文件将通过IIS运行.
    2. 如果我单击任何站点的可执行文件并导航到指定的本地主机,它们会在网络浏览器中打开.
    3. 我可以在同一系统上的任何位置运行各种形式的框架相关且自包含的.Net Core 3.1和.Net Core 5.0控制台应用程序.
    4. 这两个有效的站点在我第一次去发布时显示了相同的错误消息.我尝试调整设置,重新安装运行时等,但是未能隔离出任何导致它们在首次尝试部署几个小时后就开始运行的东西.
    5. 在有效站点和无效站点之间,应用程序池或站点本身中的设置没有明显差异.

    我认为在配置IIS,站点或应用程序池方面一定存在一些问题,但最好的是,我认为这没有什么区别.如果有人遇到过这种情况,我将竭诚为您提供建议.

    I think there must be some issue with how I've configured IIS, the sites, or the application pools, but as best I can tell there isn't any difference. If anyone has encountered this, I'm all ears for suggestions.

    推荐答案

    使用@LexLi建议(并创建)的工具,我能够确定问题是由应用程序池没有对站点文件夹的权限引起的.授予权限可以解决此问题.从错误消息中看不出来.如果有人遇到相同的错误消息,请在此处回答.

    Using the tool suggested (and created) by @LexLi I was able to determine the issue was caused by the application pool not having permissions to the site folder. Giving it permissions fixed the issue. This was not clear from the error messages. Answered here in case anyone else experiences the same error message.

    这篇关于HTTP错误500.31-无法加载ASP.NET Core运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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