after a bakup/ restore of SPWEB, if I try to Get a SPLIST by Server object Model code, it returns me
public bool OnNotification(SPAlertHandlerParams ahp)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(ahp.siteUrl))
{
using (SPWeb web = site.OpenWeb())
{
SPList lookupList = web.Lists[new Guid(ahp.a.ListID.ToString())];
//list = web.Lists[ahp.a.ListID];
}
}
});
List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.
If I try to get the same list using COM, the result is success:
string siteUrl = "http://mysite/";
SP.ClientContext clientContext = new SP.ClientContext(siteUrl);
clientContext.Credentials = new NetworkCredential("user", "pass", "domain");
SP.List oList = clientContext.Web.Lists.GetByTitle("mylist");
clientContext.Load(oList);
clientContext.ExecuteQuery();