Partilhar via


SPDisposeCheck SPSite and SPWeb Dispose() Best Practice Utility Announced

Paul Andrew (Microsoft SharePoint Product Group) announced the SPDisposeCheck utility at the Tech·Ed EMEA Developers Conference today.  The SPDisposeCheck command line utility will be released soon (North American Winter) and will recursively scan any destination folder that you specify containing custom WSS 3.0 and Microsoft SharePoint Server 2007 .NET assemblies (scanning MSIL and not the source code itself) looking for SharePoint specific Dispose() best practices (or lack thereof) as listed in the guidance on MSDN Best Practices: Using Disposable Windows SharePoint Services Objects , Best Practices: Common Coding Issues When Using the SharePoint Object Model , and my blog SharePoint 2007 and WSS 3.0 Dispose Patterns by Example .  SPDisposeCheck utility is intended to help quickly scan through a large amount of custom SharePoint code in order to direct an experienced SharePoint developer to areas of concern with regards to proper usage of Dispose().

Additional SPDisposeCheck information:

  • For developer workstations, not to be run on production
  • Built on FX Cop technology the tool opens assemblies and validates them against the Microsoft published guidance (however, not compatible with FX Cop)
  • Output will contain warnings messages for Dispose() method
  • May include “false positives” so expert analysis is required
  • Contact Microsoft support if you need assistance now

Special thanks to Microsoft’s Sean Thompson (Microsoft PFE), Scott Harris, Paul Andrew, and Stefan Goßner.  In addition, I’d like to thank the folks in the field including the MOSS MVP’s and Microsoft Services and Support (MCS/Premier/PFE/CSS) for their feedback and testing.

Comments