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

Anjali Agarwal 1,386 Reputation points
2024-03-26T21:01:06.98+00:00

I created a.net core application in Visual Studio 2022. When I see the properties, I see this:

User's image

I deployed the application on IIS and this is installed on the server:

User's image

when I do dotnet --info, I see this:

User's image

My networking person is telling me that older versions are already deprecated. When I created the application, I chose, .net 6.0(Long Term Support). below is the image:

User's image

When I navigated to my application on IIS, I saw this error:

User's image

I also tried checking the modules of my application in IIS and I see this:

User's image

Do I need to install older versions. Although, I selected, the latest version when developing the .net core application.

I really don't want to install all the older versions. The server that I am trying to deploy my code is windows server 2019 and IIS is 10.0.17763.1. I already saw some of the other forums like this: error

this is my .csproj file image:

<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>disable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
  <ItemGroup>
    
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.16" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.16" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.16">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.12" />
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2023.3.1114" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.13" />
  </ItemGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="Templates\**" />
    <Content Remove="Templates\**" />
    <EmbeddedResource Remove="Templates\**" />
    <None Remove="Templates\**" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="wwwroot\img\" />
    <Folder Include="wwwroot\FilledPDF\" />
  </ItemGroup>
  <ProjectExtensions><VisualStudio><UserProperties UseCdnSupport="" /></VisualStudio></ProjectExtensions>
</Project>

any help on this will be highly appreciated.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,238 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bouzid Kobchi 0 Reputation points
    2024-05-10T22:11:19.7166667+00:00

    any progress ?

    0 comments No comments