You should throw InvalidOperationException to indicate that an object has invalid state.
From the MSDN documentation (linked above):
The exception that is thrown when a method call is invalid for the object’s current state.
You should throw InvalidOperationException to indicate that an object has invalid state.
From the MSDN documentation (linked above):
The exception that is thrown when a method call is invalid for the object’s current state.