I am using the below code for retrieving all sharepoint lists from a site.
SPSite site = new SPSite("http://servername:port");
SPWeb web = site.OpenWeb();
SPListCollection SPlists = web.Lists;
foreach (SPList list in SPlists)
{
// do something
}
But while deploying it shows the error
"Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred."
Any ideas how can we get sharepoint lists and list items from a a site in sandboxed solution?