1. Overview
  2. Troubleshooting
  3. HTTP Error 500.31 - Failed to load ASP.NET Core runtime (To be moved to the blog site).

HTTP Error 500.31 - Failed to load ASP.NET Core runtime (To be moved to the blog site).

The article serves as a comprehensive guide, walking you through the necessary steps to resolve the aforementioned error that arises when attempting to start your server.

  1. Open the CodeStencil application.
  2.  Load the project: Ensure that you load the correct project experiencing this error. The project loaded in your CodeStencil application should resemble the image below:
  3. Ensure that both the Code Tree and Schema Dictionary are loaded, located within the blue lines representing their respective contents.
  4. When you toggle, a slider will appear in the top right corner of the image, marked by a red circle with the title Expanders. The expanders should resemble the image below:
  5. From the image above, locate the expander named DOTNET_FRAMEWORK. This expander has an assigned version. Double-click the DOTNET_FRAMEWORK field to modify the version, ensuring it aligns with the .NET version on your machine. You can verify the .NET version in Visual Studio by double-clicking on the project name. If everything is done correctly, you should see something similar to the image below:

  6. From the expander image above, check for a field called DOTNET_VERSION. You can modify the version by double-clicking on the field. Also, ensure that you have the same Entity Framework version installed in your Visual Studio. You can accomplish this by navigating to your NuGet Package and searching for Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore. Your search result should resemble the image below:
  7. Once the above steps have been completed correctly, you can regenerate the stencil and get your server running. Cheers!🥳

Was this article helpful?