Most useful .NET utility classes developers tend to reinvent rather than reuse [closed]

I recently read this Phil Haack post (The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse) from last year, and thought I'd see if anyone has any additions to the list.


People tend to use the following which is ugly and bound to fail:

string path = basePath + "\\" + fileName;

Better and safer way:

string path = Path.Combine(basePath, fileName);

Also I've seen people writing custom method to read all bytes from file. This one comes quite handy:

byte[] fileData = File.ReadAllBytes(path); // use path from Path.Combine

As TheXenocide pointed out, same applies for File.ReadAllText() and File.ReadAllLines()


String.IsNullOrEmpty()