SPDisposeCheck is a great utility for checking the disposal patterns you’re using in your SharePoint solution. Believe me, even experienced practitioners make mistakes; object disposal in SharePoint is hard.
Now, every time someone says that SPDisposeCheck is great, someone posts back that it isn’t perfect. They’re right; it won’t pick up every invalid disposal pattern – but it’s pretty good. Given the choice of it or no check, it’s a clear winner.
I’m not going to describe it much – there are good articles already out there about the problem, and how to use SPDisposeCheck. It’s also well worth installing the latest version, which integrates with Visual Studio. That’s brilliant – you can run a test over your assemblies with each build.
However, recently I took over someone else’s code; SPDisposeCheck proved invaluable, but quirky too. This post will examine some of the practical issues that I found with using it.
Continue reading “Practical SPDisposeCheck – Namespaces, Delegates and RootWebs”
