Creating an extension method for attaching key-value pairs to scope state...
This is the first in a short series of posts exploring the process I went through to make working with scopes a little nicer in ASP.NET Core (and Serilog / Seq). In this post I'll create an extension...
View ArticleUsing anonymous types and tuples to attach correlation IDs to scope state...
In my last post I gave an introduction to structured logging, and described how you can use scopes to add additional key-value pairs to log messages. Unfortunately, the syntax for key-value pairs...
View ArticleCreating and trusting a self-signed certificate on Linux for use in Kestrel...
These days, running your apps over HTTPS is pretty much required. so you need an SSL certificate to encrypt the connection between your app and a user's browser. I was recently trying to create a...
View ArticleDebugging JWT validation problems between an OWIN app and IdentityServer4
This post describes an issue I ran into at work recently, as part of an effort to migrate our identity application from IdentityServer3 to IdentityServer4. One of our services was unable to validate...
View ArticleRunning tests with dotnet xunit using Cake
In this post I show how you can run tests using the xUnit .NET CLI Tool dotnet xunit when building projects using Cake. Cake includes first class support for running test using dotnet test via the...
View ArticleFree .NET Core eBook, including ASP.NET Core and EF Core
Manning have recently released a free eBook, put together by Dustin Metzgar, called Exploring .NET Core with Microservices, ASP.NET Core, and Entity Framework Core. This eBook features five...
View ArticleExploring the ASP.NET Core Identity PasswordHasher
In this post I'll look at some of the source code that makes up the ASP.NET Core Identity framework. In particular, I'm going to look at the PasswordHasher<T> implementation, and how it handles...
View ArticleMigrating passwords in ASP.NET Core Identity with a custom PasswordHasher
In my last post I provided an overview of the ASP.NET Core Identity PasswordHasher<> implementation, and how it enables backwards compatibility between password hashing algorithms. In this post,...
View ArticleFixing the error "Program has more than one entry point defined" for console...
This post describes a problem I ran into when converting a test project from .NET Framework to .NET Core. The test project was a console app, so that specific tests could easily be run from the...
View ArticleCreating parameterised tests in xUnit with [InlineData], [ClassData], and...
In this post I provide an introduction to creating parmeterised tests using xUnit's [Theory] tests, and how you can pass data into your test methods. I'll cover the common [InlineData] attribute, and...
View ArticleCreating a custom xUnit theory test DataAttribute to load data from JSON files
In my last post, I described the various ways to pass data to an xUnit [Theory] test. These are: [InlineData] - Pass the data for the theory test method parameters as arguments to the attribute...
View ArticleCreating strongly typed xUnit theory test data with TheoryData
In a recent post I described the various ways you can pass data to xUnit theory tests using attributes such as [InlineData], [ClassData], or [MemberData]. For the latter two, you create a property,...
View ArticleHome, home on the range: Installing Kubernetes using Rancher 2.0
In this post, I give a brief introduction to Rancher and what you can use it for. Then I show how you can install it onto a host (an Ubuntu virtual machine in this case) to get Kubernetes running...
View ArticleUsing Docker Hub to automatically build a Docker image for ASP.NET Core apps
In this post I show how you can use Docker Hub's GitHub integration to automatically build a Docker image when you push to your GitHub repository. I show how to register with Docker Hub, how to setup...
View ArticleCreating a .NET Standard Roslyn Analyzer in Visual Studio 2017
In this post, I give a brief introduction to Roslyn analyzers, what they're for, and how to create a simple analyzer in Visual Studio 2017. I'll show how to create a code analyzer that targets .NET...
View ArticleBuilding ASP.NET Core apps using Cake in Docker
In a previous post, I showed how you can use Docker Hub to automatically build a Docker image for a project hosted on GitHub. To do that, I created a Dockerfile that contains the instructions for how...
View ArticleASP.NET Core in Action - What is middleware?
In February 2017, the Manning Early Access Program (MEAP) started for the ASP.NET Core book I am currently writing - ASP.NET Core in Action. This post gives you a sample of what you can find in the...
View ArticleExploring the .NET Core Docker files: dotnet vs aspnetcore vs aspnetcore-build
Note: Things have changed a lot in .NET Core 2.1, so this post is out of date. See the updated post for details. When you build and deploy an application in Docker, you define how your image should be...
View ArticleHandy Docker commands for local development - Part 1
This post includes a grab-bag of Docker commands that I always find myself having to Google. Now I can just bookmark my own post and have them all at my finger tips! I use Docker locally inside a...
View ArticleHandy Docker commands for local development - Part 2
This is a follow up to my previous post of handy Docker commands that I always find myself having to Google. The full list of commands discussed in this and the previous post are shown below. Hope you...
View Article