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:

Installation

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

Choose to install SharePoint DisposeCheck as Visual Studio add-in. Choose a folder where to install SharePoint DisposeCheck.

SharePoint development integration

The Visual Studio Add-In can be found under Tools > SharePoint Dispose Check:

Open Visual Studio an go to tools.

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.

Select the behaviour of SPDisposeCheck.

Using the following basic example you can generate a message created by the Dispose Check tool.

Possible memory leaks can be shown as errors or warnings. 

Although it gives an error the solution builds successfully and can be deployed since the tool may produce false positives.

A solution can be deployed even with errors caused by SPDisposeCheck.

Summary

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.


Get FREE & Advanced SharePoint Training, how-to's, tips & tricks:
Learn SharePoint

Comments (2) -

2/7/2011 11:47:41 PM #

Bert-Jan Diedering

Andreas, when opening the rss-feed for this post, I was asked for credentials for the images. Is that right? Something wrong with sharing images?

Bert-Jan Diedering Netherlands Reply

2/16/2011 9:20:53 AM #

Andreas Glaser

Yes images are only shown on my blog and only if HTTP referrer is enabled... I did this because of image hot linking in order to reduce the traffic.

Regarding the RSS Feed and credentials I hope it's OK since there shouldn't be anything like this.

Andreas Glaser Switzerland Reply

Pingbacks and trackbacks (1)+

Add comment


Loading