Serialize Web API HttpHeaders as JSON

Here’s a little C# extension class that serializes a set of HttpHeaders as a JSON string: View the code on Gist. NOTE: It uses the JSON.NET library to do the actual serialization. For example, if you want to serialize Web API request (or response) headers, you might do something like this: var serializedHeaders = request.Headers.ToJson(); …

Read more


Extract Custom Header Value From Web API Request

Here’s a simple C# extension method that returns the value of a custom header from a Web API request; it extends the HttpRequestMessage class: View the code on Gist. Assuming you have a HttpRequestMessage object, you can call it as such: var customHeaderValue = request.GetHeaderValue("Custom-Header"); Enjoy. Featured Image: All rights reserved by asienman

Read more


Common Outputs for Windows SC Command

I’ve been doing a bit of work with Windows services lately, in particular automated deployments of Windows services, which means I’ve been using the Windows SC command a lot. The SC command (short for “Service Controller”, located at C:\Windows\System32\sc.exe) is a really easy tool used to query/install/uninstall/start/stop Windows services from the command line. And if …

Read more


.NET Framework 4.5.1 SDK

Anyone out there remember the Arsenio Hall Show? One of his trademark gags was where he would think about certain things and would refer to them as “things that make you go hmmm”. Trying to find the download for the .NET Framework 4.5.1 SDK is one of those things. For some unknown reason, Microsoft decided …

Read more


Installing RabbitMQ on Windows

I’ve had to get RabbitMQ up and running on Windows a couple of times the last few weeks and instead of fumbling my way through it again, I captured the steps for a walkthrough. Here’s the rundown for how to install and configure RabbitMQ on Windows. NOTE: This is just to install a single RabbitMQ …

Read more


Fixing PostSharp AssemblyLoadException for Newtonsoft.Json

Recently, we’ve started using PostSharp in our applications (specifically, the OnMethodBoundaryAspect to enhance our logging capabilities) and things have been going smoothly. That is, until today when I wanted to upgrade all of our Newtonsoft.Json references to the latest version (going from 6.0.8 to 7.0.1). As I worked my way through various projects performing the …

Read more


The Software Architect

For much of my career I’ve played the architect role on various software projects, whether that’s product development, consulting gigs, or in-house web apps. I’ve always tried to make a positive impact when I’m in that role, but something that’s always bothered me is the sometimes-negative-stigma about architects. Many people look at “architects” as just …

Read more


Order of Using Directives in C#

There are many things in software development that have ignited holy wars over the years. Stored procs vs ORMs. Tabs vs spaces. Emacs vs Vi. You name it and software developers have most likely argued about it. This post isn’t meant to start another holy war, but I’ve had a couple conversations about it the …

Read more