Matthew King
Home
Blog
About
Consulting
Miscellaneous
Home
Blog
About
Consulting
Miscellaneous
01 Oct 2023
Formatting conventions for primary constructors
A discussion on how the C# community should format code that uses primary constructors
Read full post
10 Sep 2023
Vic Bias in the AFL
An analysis of Vic Bias in the AFL, and a discussion of how much it matters
Read full post
31 Aug 2023
Keeping console windows open
A quick explanation on how to set up your C# console application to keep its window open when launched from the Windows GUI
Read full post
14 Dec 2022
Celebrating one million downloads on NuGet
My open source projects have recently ticked over 1 million downloads on NuGet. This post gives a quick overview of my most popular projects.
Read full post
27 Apr 2022
Using Log4j/Log4net-style short log levels with Serilog
A simple code snippet that allows you to use Log4j/Log4net-style short log levels with Serilog
Read full post
23 Dec 2021
Declaring InternalsVisibleTo in a csproj file
A quick overview of how to declare InternalsVisibleTo in a csproj file.
Read full post
22 Sep 2021
Converting HTML to PDF in .NET using Puppeteer Sharp
A quick overview of how Puppeteer Sharp can be used to convert HTML to PDF files in the .NET ecosystem
Read full post
18 Dec 2020
Getting rid of VSCode's attribute wrapping in HTML files
How to tell VSCode to stop inserting newlines into your code just because it wants to wrap your HTML attributes
Read full post
11 Dec 2020
Dealing with error CS0518: 'IsExternalInit not defined or imported'
A quick explanation of how to deal with error CS0518, which may occur when trying to use init setters on frameworks earlier than .NET 5.0
Read full post
10 Mar 2020
.NET Project Layout
A standard layout for .NET projects.
Read full post
04 Oct 2019
Detecting .NET Framework versions with WiX
How to use WixNetfxExtension to detect .NET framework versions (including those higher than 4.6.2)
Read full post
11 Apr 2019
Working with private setters in Json.NET
How to use a custom contract resolver to deserialize to an object with private setters in Json.NET
Read full post
12 Mar 2019
Avoiding overuse of 'manager' classes
There are only two hard problems in computer science: cache invalidation and naming things.
Read full post
04 Dec 2018
Cheap and easy ASP.NET Core hosting
A quick overview of some of the options for hosting ASP.NET Core sites and apps.
Read full post
19 Aug 2018
Using the WinForms designer on high‑DPI systems
A couple of registry hacks to use Visual Studio's WinForms designer on high‑DPI systems without causing problems for the rest of your team.
Read full post
18 Aug 2018
Programmatically determining whether a Windows user is idle
An overview of how to determine if a Windows user is idle by checking when they last interacted with the PC (using the Win32 GetLastInputInfo API).
Read full post
17 Aug 2018
Google AdSense Tag Helper for ASP.NET Core
A simple ASP.NET Core Tag Helper that emits Google AdSense ad code.
Read full post
20 May 2018
Inlining and downloading a web page for offline consumption
A guide showing how to download a web page as a single HTML file with all CSS, JS, and images embedded into it.
Read full post
02 Apr 2018
WinForms clipboard monitoring
A quick example showing how to monitor the clipboard in a WinForms project.
Read full post
11 Mar 2018
Simplifying filter strings for file dialogs in WinForms and WPF
Using my FluentFileFilterBuilder library to easily craft file filters for the WinForms and WPF file dialogs.
Read full post
05 Nov 2017
Google Analytics Tag Helper for ASP.NET Core
A simple ASP.NET Core Tag Helper that emits Google Analytics tracking code.
Read full post
04 Nov 2017
Setting a WinForms form to be hidden on startup
An overview of my preferred technique for setting a WinForms form to be hidden on startup (without the drawbacks of some of the other common approaches).
Read full post
03 Oct 2017
Hosting and deploying ASP.NET Core apps with ZEIT Now
An overview of ZEIT Now, and a quick tutorial showing how to use it to host and deploy an ASP.NET Core app.
Read full post
02 May 2017
A better alternative to the WinForms Folder Browser Dialog using Ookii.Dialogs
A critique of the shortfalls of the WinForms FolderBrowserDialog, and a quick overview of the alternative provided in the Ookii.Dialogs project.
Read full post
12 Mar 2017
What I install on a fresh Windows development PC
A short overview of the software that I always install on a fresh Windows PC to get up-and-running for .NET development.
Read full post
16 Feb 2017
Documenting Task returns (in C# XML Documentation Comments)
Some recommendations on how to write XML Documentation Comments for methods that return a Task object.
Read full post
14 Oct 2016
Using Visual Studio Code as the default Git editor
A quick guide on how to set up VSCode as the default Git editor.
Read full post
03 Sep 2016
Registering services with Scrutor
Using Kristian Hellang's Scrutor library to scan and automatically register dependencies with the Microsoft.Extensions.DependencyInjection IoC container.
Read full post
31 Jul 2016
Generating a unique identifier for a Windows PC
Using my DeviceId library to generate unique identifiers for Windows PCs.
Read full post
25 May 2016
SourceTree custom action: Open solution in Visual Studio
A quick guide demonstrating how to set up SourceTree custom actions to search a repository for a Visual Studio Solution File and then open it in Visual Studio.
Read full post
24 May 2016
Enabling tab on WinForms property grids
An in-depth look at how to extend the WinForms PropertyGrid control to enable tab-navigation between properties.
Read full post
27 May 2014
Programmatically launching ClickOnce applications
An in-depth look at the various ways that ClickOnce applications can be programmatically launched.
Read full post
12 Apr 2014
Fixing GeoCoordinateWatcher's event handlers
Identifying and fixing a bug in GeoCoordinateWatcher's event handlers.
Read full post
14 Mar 2014
Grouping files in Visual Studio
A quick tutorial on how to nest/group files within Visual Studio using the <DependentUpon> property in a project file.
Read full post
09 Feb 2014
Fun with C# dynamics
A brief introduction to C# 4's dynamic keyword, and the fun that can be had with it.
Read full post
04 Feb 2014
Forging Skype quotes
A overview of how Skype quote elements are structured, and a program that allows them to be forged.
Read full post
13 Jan 2014
Ruby: The Good Parts
In the spirit of Douglas Crockford's book 'Javascript: The Good Parts', I present an exhaustive list of the 'good parts' of Ruby.
Read full post
11 Jan 2014
Quick and easy custom syntax highlighting in a WinForms text box
A look at how to use the FastColoredTextBox library to get quick and easy WinForms syntax highlighting.
Read full post
02 Dec 2013
Password security best practices (with examples in C#)
A brief rundown of some of the common mistakes people make with password security, and then an overview of some 'good practices' (with examples in C#).
Read full post
30 Nov 2013
Cue banners in WinForms
A look at how WinForms text boxes can be extended to have a 'cue banner' (that greyed-out placeholder or explanatory text often seen in text fields).
Read full post