Posted on


Luis Valencia - Sharepoint Architect

There is not a big deal in this error from the author, but its interesting that somebody from Microsoft itself makes this mistake after its revealed in the disposal best practices.

Chapter 3:  Introduction o the Sharepoint Object Model.

Page 185.

He used:

using(SPWeb rootWeb = site.RootWeb)



This is not a good coding practice because the RootWeb does not need disposal, I had SPRequest errors in my log in the past because of this exact same line.  SO AVOID IT.

this is documented here:

View original post


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s