InvalidOperationException

The .NET exception thrown when a call is not valid for the object's current state, such as First on a sequence with no match.

In more detail

It signals a problem with when or how a method was called rather than with a particular argument. The course also throws it on purpose in async examples to show how exceptions travel across await.

Related terms

Taught in

References