Automate SharePoint Dispose() code reviews with SPDisposeCheck

Today the Microsoft SharePoint Product Team announced the SPDisposeCheck utility here and also at Paul Andrew’s blog here. You can download the free SPDisposeCheck utility in the MSDN Code Gallery http://code.msdn.microsoft.com/SPDisposeCheck . The SPDisposeCheck utility will assist you dig through your custom SharePoint MSIL assemblies (DLL’s and EXE’s) looking for areas in your code that…

3

SharePoint 2007 PublishingWeb.GetVariation() Method Leak

PublishingWeb.GetVariation() method returns a PublishingWeb object which which needs to be explicitly Closed() as shown in the following code sample.  For a complete list of all the updated SharePoint Dispose() guidance please see SharePoint 2007 and WSS 3.0 Dispose Patterns by Example . void GetVariationLeak() { using (SPSite siteCollection = new SPSite(“http://moss”)) { using (SPWeb…

1

SharePoint 2007 UserProfiles.PersonalSite Property Leak

The following edge case applies to MOSS 2007 (and not WSS 3.0).  When using the following pattern the property Microsoft.Office.Server.UserProfiles.PersonalSite requires a Dispose() call before leaving scope if you use the property in your code.  Below is an example of a common usage of PersonalSite property. void PersonalSiteLeak() { // open a site collection using…

2

try / finally using() SharePoint Dispose()

Chances are that by now if you have been developing on the Microsoft SharePoint Office Server (MOSS) 2007 and Windows SharePoint Services (WSS) 3.0 Object Model (OM) for any length of time you are aware of the importance of when to (and when not to) call Dispose() on your SharePoint Objects.  However, you may not be…

12

CTP of VSeWSS 1.3 Announced – Now installs on 64bit OS

Paul Andrew just announced on the Microsoft SharePoint Team Blog that a new Community Technology Preview (CTP) version of the Visual Studio extensions for SharePoint 1.3 (VSeWSS 1.3) is now publically available on Microsoft Connect site. New Features in VSeWSS 1.3 The extensions now install on x64 bit OS. Visual Studio 2008 and SharePoint must…

0