Showing posts from November, 2021

DotNet Core deployment IIS: http error 500.31 - failed to load asp.net core runtime

I'm trying to host a Web application built on top of ASP.NET Core to IIS on a Windows 10 machine. I  received the following error when I tried to navigate to the default landing page of the application:  HTTP Error 500.31 - Failed to load ASP.NET Core runtime "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…

How to Change the Default Home Page in ASP.NET Core Razor Pages

ASP.NET Core is a popular web development framework that provides a robust set of tools and features for building dynamic, interactive websites. One of the key components of ASP.NET Core is the Razor Pages framework, which makes it easy to build dynamic pages and web applications. By default, the home page of an ASP.NET Core Razor Pages website is set to the index.cshtml file. However, you may want to change the default home page to a different file, depending on your needs and requirements. In this article, we will show you how to change the …

Detecting Debug mode in ASP.NET Core / .NET 5

I was working on a caching framework in ASP.NET Core and one thing I needed to know whether the application is running in debug mode. In the regular .NET framework, this was available through the HttpContext, as per the following syntax: HttpContext.Current.IsDebuggingEnabled In ASP.NET Core, this property is not available anymore and the HttpContext is now accessible from the Http namespace: Microsoft.AspNetCore.Http.HttpContext Therefore, the usual way to check if the ASP.NET Core application is in debu…

Load More
That is All