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.
- Open the CodeStencil application.
- 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:
- Ensure that both the Code Tree and Schema Dictionary are loaded, located within the blue lines representing their respective contents.
- 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:
- From the image above, locate the expander named
DOTNET_FRAMEWORK. This expander has an assigned version. Double-click the
DOTNET_FRAMEWORKfield 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:
- 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:
- Once the above steps have been completed correctly, you can regenerate the stencil and get your server running. Cheers!🥳