What exceptions should be thrown for invalid or unexpected parameters in .NET?

asked16 years ago
last updated16 years ago
viewed151.9k times
Up Vote200Down Vote

What types of exceptions should be thrown for invalid or unexpected parameters in .NET? When would I choose one instead of another?

Follow-up:

Which exception would you use if you have a function expecting an integer corresponding to a month and you passed in '42'? Would this fall into the "out of range" category even though it's not a collection?