Is there a tool available that can scan code and check for possible null reference exceptions, i.e. where there is no code to check for null before calling a method / accessing a property?
+5
A:
Resharper will offer suggestions for when you might have accessed a member on an object that could be null.
In 4.0, "code-contracts" support this at compile time - for example, it will stop you passing a possible-null into a method that states it doesn't want one.
Marc Gravell
2009-07-15 12:32:55
+1
A:
RedGate has a commercial tool called Exception Hunter that can analyse your (compiled) code and show which exceptions can be thrown from an given function. You can also find all methods that throw a particular exception.
adrianbanks
2009-07-15 12:44:09
A:
Perhaps you may be interested in the new contracts goodies in .NET 4.0?
Ion Todirel
2010-05-10 11:51:14