Once in a while I happen to have a project that simply closes when a file such as .resx or .xaml is openened in Visual Studio 2008 – even when there is nothing wrong with the files themselves.

When that happens, errors are logged to the Event Viewer, but they are not that helpful – for a change.

To avoid that error, there is a couple of ways. First of all, delete the .suo file in your solution folder. Deleting that file will do no harm to your solutions, as it only stores user-specific information, such as what are your opened files, which directories in Solution Explorer are collapsed or not, etc.

That usually works. However, not always, specially with .xaml files. If VS2008 insists in closing after deleting .suo, next time you open the .xaml file, simply press ESC repetitively, the way maniacs do. That will avoid the design view to be loaded – which apparently breaks VS2008. If you are successful in not seeing VS2008 to close again, you can close your file and re-open it. Hopefully.

What if Visual Studio still closes? Good luck, my friend.