Once I happened to have problems with my fairly simple application. It was compiled with output type of Windows Application. It started to die on Windows 7, and after adding a check
if (args != null)
before using args variable for the first time, the problem disappear. Beware! Framework 3.5.1.