Is there a tool for C# which can statically (without executing the code) detect out of bound array access, i.e., array access that will throw IndexOutOfRangeException.
Thank you.
EDIT: Yes, I am aware that it is a theoretically impossible to do it in general case (i.e., it is undecidable), but that that does not mean that it is not possible to do it for some cases (in fact the whole field of formal verification is about producing practical tools for theoretically impossible things). (I didn't think this commend was specially required :))
Yes, Code Contracts for .NET. See this article in MSDN magazine.