Razor Pages
Cannot convert from 'long?' to 'long'
I use a code similar to the following to accept the value for a query string named Id on one of my pages of a .NET Razor Page application. It is an optional query string. Its value is then passed to another function for further processing. When I compile the code, I get the error message "cannot convert from 'long?' to 'long'"
Tags: Troubleshooting
Unable to resolve service for type 'System.Net.Http.HttpClient' while attempting to activate... error
When I tried to register a service that uses an object of System.Net.Http.HttpClient for dependency injection, I got this error "Unable to resolve service for type 'System.Net.Http.HttpClient' while attempting to activate "
Tags: Troubleshooting
HTTP Error 500.34 - ASP.NET Core does not support mixing hosting models
"HTTP Error 500.34 - ASP.NET Core does not support mixing hosting models". You will get this error if you host two .NET Core web applications in the same application pool using In-process hosting. This error can be fixed using two methods. One solution is using different application pools for the web applications. The other solution is changing the hosting model of the applications to "OutOfProcess".
Tags: Troubleshooting
HTTP Error 500.30 - ASP.NET Core app failed to start
You may see an HTTP 500.30 error when your ASP.NET Core web application fails to start. This article explains how you can check the error details when you don’t have access to IIS and the web server.
Tags: Troubleshooting