Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

What is your experience with the Code Analysis Framework? Wrong error messages, overlook errors messages etc.

Error List:

  1. SPDispose Check and the SPSiteRootWeb - Wrong SPDispose Error Dispose SPSiteRootWeb
share|improve this question

1 Answer 1

It might be helpful to be a little more specific in your question. It's definitely possible to get false positives in MSOCAF, and if you can provide a good explanation for it you should be able to submit the explanation as part of the documentation with your change request.

In this case, the rule you referred to is (I believe) generally triggered by explicitly disposing of SPSite.RootWeb object, instead of just disposing the SPSite itself. The RootWeb will be cleaned up automatically, and in fact manually disposing it can cause issues. Generally, just dispose of the SPSite as long as it's one that you're actually supposed to dispose (i.e. not just hanging off a context object). The links in the article you referenced have much more detail on these topics.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.