c# - HTTP Error 500.31 - Failed to load ASP.NET Core runtime

c# – HTTP Error 500.31 – Failed to load ASP.NET Core runtime

c# – HTTP Error 500.31 – Failed to load ASP.NET Core runtime

In my case, the target machine was missing the ASP.NET Core runtime itself.

n

Issue is resolved after installing the Hosting Bundle fromn.Net Core 3.1

I was getting the same error messages for a new .NET Core 3.1 framework-dependent web app on an IIS server which was already hosting other .NET Core 3.1 framework-dependent web apps with no problem. The messages in Event Viewer were slightly different; but also very hard to find – sometimes I couldnt see any events which seemed to relate.

n

If I converted the site to stand-alone win-x86, it worked; but stand-alone win-x64 didnt work.

n

After days of…

n

    • n

    • Reading the information on the linked Microsoft URL in the error message,

n

    • running the site from the command line (no problem),

n

    • checking dotnet --info on the IIS server,

n

    • checking dotnet --info on the build server,

n

    • staring at JSON config files, project files, build settings, publish settings and IIS settings

n

n

…this turned out to be an AppPool setting.

n

In the AppPools Advanced Settings, there is an Enable 32-Bit Applications setting, which IIS considers the default to be False; but on mine was True. Toggling this setting caused the site to work and fail, when False and True, respectively.

n

It had been set to True on my site because we use to deploy our site, and the IIS AppPool xe2x80x93 Create step has an option relating to this setting; but in Octopus, the default value is True, so this needed turning off.

c# – HTTP Error 500.31 – Failed to load ASP.NET Core runtime

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.

Related posts on c HTTP Error :

Leave a Reply

Your email address will not be published.