Quick start to C# .NET Core with MongoDB in Docker

Although I've been using MongoDB for a while, I realised I'd never started a greenfield project. Not wanting to install yet more software on my laptop, I realised this was a perfect fit for Docker.

Here's a quick start guide to getting C# .NET Core querying a MongoDB docker instance I used to get up and running.

Docker WSL 2 error 0xffffffff

Since upgrading Windows 10 to version 2004 and upgrading docker for Windows to use WSL 2 I've been getting a very unhelpful "error 0xffffffff" when launcing a bash prompt.

I'm sure it will get fixed at some point, but for the mean time it seems something is hogging port 53 and causing conflicts. Thankfully there's some PowerShell to fix it.

Docker - the user has not been granted the requested logon type at this computer.

Sometimes when I start working with docker for the day, I get a "Logon failure:the user has not been granted the requested logon type at this computer." error.

I haven't been able to reliably reproduce this issue, so I don't really know the cause. Thankfully a reboot generally fixed it, but there's also a quicker way.