There is very little documentation and examples around on how to do this. And when you get stuck on something, you might not know what to search for. So here is a complete example for C#. I’m using a NuGet …

Generate a new X509Certificate2 with extensions and private key, in C# Read more »

This is a recipe for setting up a Blazor Server App with authentication. We’ll look at: How you setup Login/Logout buttons How to change the menu depending on whether you are already authorized or not How to get the [Authorize] …

Securing Blazor Server App using IdentityServer4 Read more »

The fastest way to create certificate files, is using the makecert command. You can see how to do this here: https://brockallen.com/2015/06/01/makecert-and-creating-ssl-or-signing-certificates/ If you are having problems with makecert, you can also create certificates using the Internet Information Services (IIS) Manager. …

Create self-signed certificate using IIS Manager Read more »

Overview For our web applications, we use Application Insights for log messages and metrics. We also want to use Azure Log Stream and Live Metrics. How to set this up usually changes between major version of ASP.NET Core, so finding …

AppInsights and logging with Serilog Read more »

This is a recipe for setting up SwaggerUI for a secure Asp.Net Core 2.2 WebApi. In this recipe we will use the ClientCredentials flow. This means that you must get the token from somewhere, or generate it programmatically. Later I’ll …

Swagger UI and Authentication in Asp.Net Core 2.2 Read more »

Sharing Entity Framework repositories across different frameworks was harder than I thought, so I created a recipe. I wanted to put my EF code inside a NuGet package, and from a consumer, I didn’t want to think about database stuff. …

EntityFramework Core 2.1 in .NET Standard 2.0 NuGet package Read more »