FxCop issues a violation of rule CA2201 if you throw System.IndexOutOfRangeException
in your code (see reference). The rationale for this is that System.IndexOutOfRangeException
is "reserved and should be thrown only by the common language runtime" according to the documentation.
But what can actually go wrong if you throw System.IndexOutOfRangeException
?