Geeks With Blogs
Clara's Notes on Technology Notes to me and the world

In one of the pages of my SharePoint application, I added a Links web part (web part that shows the contents of the a links list). Pretty simple. Then, I se tthe "XSL Link" property so that the results were customised in a certain style. Then I got this really strange error:

Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED)) 

After some searching I understood it meant that the current SPContext could not be accessed. I then realised that another (custom) web part in the page was destroying the SPContext object after use, so when the Links web part (OOTB) tried to use it, it couldn't.

Look for anything like

(SPWeb site = SPContext.Current.Site) {...}


in your custom web part code. This is wrong. You must not dispose the current site object. Instead you can use something like:

using (SPWeb elevatedSite = elevatedsiteColl.OpenWeb(siteID)) { ... }

Guid siteID = SPContext.Current.Web.ID;



Links that help me:


Posted on Wednesday, April 13, 2011 2:53 PM SharePoint | Back to top

Comments on this post: Attempted to use an object that has ceased to exist

# re: Attempted to use an object that has ceased to exist
Requesting Gravatar...
This helped me a lot. Thank you very much. I fixed my issue like this.
Left by JAMAL on Aug 04, 2011 5:05 PM

Your comment:
 (will show your gravatar)

Copyright © Clara Oscura | Powered by: | Join free