Sharepoint GetList or GetListFromUrl fails (0x80070001 or 0x80004005)

maybe it looks like this
 Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException: <nativehr>0x80070001</nativehr><nativestack></nativestack>

anyway, the problem might be that you changed context, you're in a handler (Ajax request), or moved references of SPContext or SPSite to a mehtod, or opened a new site and web.

the 2 methods above, GetList or GetListFromUrl, usually will work with non-100%-complete parameters, like "/Pages", but with the context a bit changed it must have the 100% parameters.

the GetListFromUrl just need "/Forms/AllItems.aspx" in the end, while the GetList need the full url, so try this:

web.GetList[site.MakeFullUrl("url part")]

and if your "url part" is just "/Pages" add web url like this:

web.GetList[site.MakeFullUrl(web.ServerRelativeUr + "url part")]


Popular posts from this blog

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

c# Service Play Sound with NAudio example by Moshe

MatDatePicker Errors