SPDisposeCheck is one of the most important tools for SharePoint development since it checks custom solution using the SharePoint object model for possibly memory leaks and reports them to you.
The tools has been updated December 2010 (12/13/2010) and can be downloaded here:
Don’t use the download tab… just look inside the text for the download link. More information can be found here:
During installation you can choose to integrate SPDisposeCheck into Visual Studio 2008 or 2010. It’s still a command line utility and is called by the Visual Studio Add-In. Supported SharePoint installations are:
- SharePoint Server 2010
- SharePoint Foundation 2010
- Microsoft Office SharePoint Server 2007
- Windows SharePoint Services 3.0
SharePoint development integration
The Visual Studio Add-In can be found under Tools > SharePoint Dispose Check:
I have tested it with the Visual Studio 2010 SharePoint templates.
After creating a project and I have opened the SharePoint Dispose Check window where you can select if problems should be treated as errors or warnings… in both cases the solution can be build successfully and deployed.
Using the following basic example you can generate a message created by the Dispose Check tool.
Although it gives an error the solution builds successfully and can be deployed since the tool may produce false positives.
I haven’t yet tested the integration with solutions based on custom templates instead of the Visual Studio 2010 SharePoint templates.
If it’s different I will cover it in another post about SharePoint development.