SharePoint 2007/2010 “Do Not Dispose Guidance” + SPDisposeCheck

Below I put together a quick reference of the known SharePoint properties and methods that you do not want to call Dispose against when developing SharePoint applications (AKA “Do Not Dispose Guidance”).  Please check back on this blog post as I will be keeping it updated as we move closer to the SharePoint Server 2010…

7

SharePoint Conference 2009 Developer Hands On Labs (HOLs)

Whether or not you were one of the lucky ones to attend the sold out SPC ‘09 conference in Las Vegas last week you should download and review the 10 developer Hands On Labs (HOL’s) in anticipation to the public beta of SharePoint Server 2010 due out in November 2009. You can download the 10…

0

Updated Patterns & Practices Developing SharePoint Applications Guidance

Congrats to Chris Keyser and all the authors/contributors for shipping the updated Version 2 of the SharePoint Developers Guidance.. must have free resource if you are doing development with SharePoint. Guidance for building collaborative applications that extend your LOB systems The guidance provides value for experienced developers just starting in SharePoint development as well as…

0

SharePoint STSADM Silverlight application on TechNet

Go check out the cool new TechNet interactive online Silverlight application which allows you to quickly browse and filter STSADM commands with links to the documentation. Stsadm Technical Reference for Windows SharePoint Services 3.0 Stsadm Technical Reference for SharePoint Server 2007

1

Announcing Developer Best Practices Resource Center for SharePoint Server 2007

Find up-to-date guidance about how to write Microsoft Office SharePoint Server 2007 applications and customizations that perform well, avoid common pitfalls, and best use the features of the SharePoint object model. http://msdn.microsoft.com/en-us/office/dd638301.aspx

1

SharePoint Diagnostics Tool v1.0 (SPDiag) Released

There is a new GUI utility published today to Microsoft.com/downloads for x32 and x64 environments which should help cut down the ping pong performance related troubleshooting discussions between IT staff, support, and developers regarding the SharePoint farm itself. Use the tool to collect data from performance counters, ULS log files, IIS log files, event logs,…

1

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