Archive For The “.NET” Category
Here is a contrived example of a common SOLID violation you might see. Can you spot it? Except in trivially simple cases, there should always be a class boundary when shifting context from coordinating a collection versus performing actions on a single object. The class above is violating this rule — it knows how to [...]
Just a quick tip I found today – If you’re a NuGet package author and want to be notified when updates are published for upstream packages you depend, you can do so by subscribing to an OData query in an RSS reader. For example, in order to keep protobuf-net-data in sync with the latest protobuf-net, [...]
.NET, as a mostly-statically typed language, has a lot of really good options for serializing statically-typed objects. Protocol Buffers, MessagePack, JSON, BSON, XML, SOAP, and the BCL’s own proprietary binary serialization are all great for CLR objects, where the fields can be determined at runtime. However, for data that is tabular in nature, there aren’t [...]
When working with SQL, I often find I need to quickly spin up/tear down local developer database instances – for example, setting up a clean environment for integration tests on the build server, or blowing away test data. To help make this easier, here are a couple of MSBuild tasks I wrote that allow you [...]
Here’s a little CLR brain teaser for you: A method is throwing a NullReferenceException. The stack trace indicates it is originating on a line that has only a closing curly brace on it (i.e. }). How could this be explained? Note that: The code is not optimized. The PDB file is the correct version. The [...]


