Do you know of String.IsNullOrEmpty and do you use it? You do? Think again after reading this blog post. Ooops, it might not work and even worse, it might not work only in release (optimized) configuration. Apparently JIT optimizer is to blame. What a nightmare for a developer – the same program might not work deployed at client and worse, the bug is not easy to catch either.
But now, here comes the cherry on the cake. MS recognizes this bug and they will fixes it soon, post Orcas. Note that Orcas is targeted for late 2007 or something.
I guess I’ll have to replace all my String.IsNullOrEmpty calls with text == null || text == string.Empty.