3

im searching for any tool that can detect any missing dispose calls on classes that do data access and file operations. And if it checks another performance issues it will be nice.

BTW, i need to run the tool over the code, not on the execution. Thanks!

poupou
  • 43,413
  • 6
  • 77
  • 174

3 Answers3

5

DevExpress CodeRush does this for you:

see this article: Code Issues – Undisposed local

Code Rush home: DevExpress CodeRush

I have used the express version of this tool and personally I like it more than ReSharper.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • no, it looks like somebody tried to implement this in ReSharper, you can read the thread: http://stackoverflow.com/questions/3097145/resharper-custom-search-pattern-to-warn-idisposable-objects – Davide Piras Sep 20 '11 at 23:01
  • 1
    @ David Piras : +1 for CodeRush. – CharithJ Sep 20 '11 at 23:06
2

The open-source Gendarme tool provides several rules wrt IDisposable.

disclaimer: I'm Gendarme's maintainer.

poupou
  • 43,413
  • 6
  • 77
  • 174
1

If you prefer a free utility, FxCop does this.

Joe
  • 122,218
  • 32
  • 205
  • 338