CLR 4.0: Corrupted State Exceptions
- by Scott Dorman
Corrupted state exceptions are designed to help you have fewer bugs in your code by making it harder to make common mistakes around exception handling.
A very common pattern is code like this:
public void FileSave(String name)
{
try
{
FileStream fs = new FileStream(name, FileMode.Create);
}
catch (Exception e)
{
…