The utility can be downloaded here:
http://code.msdn.microsoft.com/SPDisposeCheck
To integrate the utility into your development environment, in Visual Studio go to the "Tools" menu and select the "External Tools" menu item. Select "Add" and configure the tools options as follows:
The command argument should point to the SPDisposeCheck executable. Pass the project BIN directory as an argument, and set the initial directory to your solution directory. Select the "Use Output window" check-box so that the results from the tool display in the Visual Studio output window.
To use the tool, select a project in your solution, and then select the "SPDispose Checker" utility from your tools menu. The results from the tool will display in the output window. If you have any improperly disposed objects, the results in your output window will direct you to where the problems are located in the assembly.
More information about the proper disposal of SharePoint objects the following blog has a great deal of information:
http://blogs.msdn.com/b/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx
No comments:
Post a Comment