Friday, September 29, 2006 10:48 PM
Mickey Williams
String.IsNullOrEmpty is broken
If you're using string.IsNullOrEmpty, be aware that there is a fatal bug in the JIT compiler that causes a null reference exception:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=113102
This means that String.IsNullOrEmpty is not safe for use in any production .NET 2.0 project.
Note that the "workaround" effectively amounts to "don't use string.IsNullOrEmpty" -- write your own version, and slap a MethodImpl attribute on the method to prevent JIT optimization.