Warning: I'm an asp.net developer taking my first steps in SharePoint.
So, i'm writing a console application that connects to a SharePoint Server 2007 site on the same machine, but it seems that something goes wrong during the call to SPSite() constructor. Here's the simplified code:
using (SPSite siteCollection = new SPSite("http://server/AwesomeSite"))
{
//when i set a breakpoint on this line and inspect the siteCollection object,
//most of it's properties (for example siteCollection.AllWebs.Names) throw an
//exception, which leads me to the conclusion that something went wrong during
//the constructor above.
SPWebCollection site = siteCollection.AllWebs;
SPWeb web = site[""];
SPList list = web.Lists["AwesomeList"]; //exception occurs here
}
The SPException text:
Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
I followed the advice of http://stackoverflow.com/questions/806533/sharepoint-spsite/806617#806617 and checked that:
- The user is a server farm administrator.
- The user has Read and Write permissions on the content database.
- The user is a site collection administrator.
- The user has permissions to access the Windows SharePoint Services site or the SharePoint Server 2007 site through which the code iterates.
And they are all correct. What else could be causing this to happen?