Thursday, December 17, 2009

Use SPDisposeCheck Tool for Sharepoint Objects

SPDisposeCheck is a tool to help you to check your assemblies that use the SharePoint API so that you can build better code. It provides assistance in correctly disposing of certain SharePoint objects to help you follow published best practice. This tool may not show all memory leaks in your code.
Download SPDisposeCheck from

http://code.msdn.microsoft.com/SPDisposeCheck

Path of SpDisposeCheck in system : "c:\Program Files\Microsoft\SharePoint Dispose Check\"
Run the following command against assembly :

c:\>Spdisposecheck "Path of Assembly " >> "output filename with full path"

Best practice notes of SPDisposeCheck , refer below link:
http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx

Regards,
Shobha