I have been newly assigned to a client and I am trying to run an existing console app to get some information about files within their sharepoint instance. The code goes something like this:
//Enter function
webURL = "http://mysite/mysub/";
using (SPSite site = new SPSite(webURL))
{
using (SPWeb web = site.OpenWeb())
{
Console.WriteLine("Running");
RunningFoo(web);
}
}
Console.WriteLine("end");
}//exit function
private void RunningFoo(SPWeb web)
{
Console.WriteLine(web.Url.ToString());
//do important stuff
}
The output is:
Running
end
There is nothing wrong with the actual code or arguments supplied because the existing developer runs this with no problems. It is my suspicion that site.openWeb is returning a null object but I dont have access to the development tools to do debugging. Is there any way I can check to ensure my permissions (server-side and ecms login) are sufficient to do this? It is very possible that the server itself is blocking me from utilizing certain network services but it is also possible that my sharepoint permissions do not allow me to run custom code.
Any help is appreciated! Thanks
Update: I believe this may be an issue with permissions on the database server. I tried running an stsadm command the other day and received an access denied error on the database.