Entries Tagged as '.Net'

Monday, February 23rd, 2009

Overloading == in C#

When overriding the == operator on immutable objects, I’ve previously done something akin to public static bool operator ==(MyThing x, MyThing y){    // Null tests    try {var ignore =  x.GetType(); } // Provoke NRE    catch(NullReferenceException)    {        try        {            var ignore = y.GetType();            return false; // Only one operand null        }        catch (NullReferenceException)        {            // Both [...]

Thursday, June 5th, 2008

IIS not acknowledging WCF service

Ever had a problem with a IIS-hosted WCF service suddenly deciding not to work anymore, despite no apparent change has been made to your system? The culprit is probably some weird windows update, or maybe your corporation (like mine) likes to automatically distribute registry hacks that have only been tested on “clean” boxes with nothing [...]