Posts

Showing posts from January, 2011

Why do I keep getting exception code e0434352?

If you want to know how to debug CLR exceptions using cdb then read this post . Exception code e0434352 is the exception code used internally by the CLR to represent most exceptions(*). Regardless of if you throw a System.NullReferenceException or a System.ArgumentException in C#, you'll throw a SEH exception e0434352 under the covers. A fun way to validate this theory is to watch what happens to the CLR exceptions settings in cdb. Fire up cdb, and see the state of clr exceptions: 0:000> .shell -ci "sx" findstr clr clr - CLR exception - second-chance break - not handled clrn - CLR notification exception - break - handled .shell: Process exited Now, set the exception handler for exception number e0434352 and recheck the value of the clr exception handler: 0:000> sxe e0434352 0:000> .shell -ci "sx" findstr clr clr - CLR exception - break - not handled clrn - CLR notification exception - break - handled .shell: Process exited Armed with

Using NUnit to explore static field initialization

Given the following code: class Constants { public static readonly Constants Instance = new Constants(); public static readonly string ApplicationName = "ig2600"; public readonly string CachedClassName; public Constants() { CachedClassName = GetQualifiedClassName("Constants"); } public static string GetQualifiedClassName(string className) { return string.Format("{0}::{1}", ApplicationName, className); } } Which of the below tests pass? [TestFixture] public class TestConstants { [TestFixture] public class TestConstants { [Test] public void TestOne() { Assert.That(Constants.Instance.CachedClassName, Is.EqualTo("ig2600::Constants")); } [Test] public void TestTwo() { Assert.That(Constants.Instance.CachedClassName, Is.EqualTo("::Constants")); } } } Not sure? Download the code with

SSDs rock - but not for the reasons you think

I bit the bullet and picked up an SSD. It's expensive, but it had some surprising benefits. The normally quoted benefit is speed - which I really don't notice. Most operations went from some annoying amount of time, to some other annoying amount of time. I did notice two things: 1) Silence:  I'm so used to hearing my laptop harddrive I couldn't figure out what I was missing - there is no more annoying grindings; clicking or whirring. 2) Coolness: SSD's run cooler - which means less spinning fan, which means more silence UPDATE: The most valuable thing about the SSD is the harddrive doesn't die when I drop the laptop, if you don't have an SSD in your laptop it's totally worth it! (Update: A short,  highly entertaining talk about SSDs - mostly for servers here )