Hi,
We have created a virtual directory under the root sharepoint site. This virtual directory hosts a Web Service which is accessed anonymously. In the code we are doing the following:
using(SPSite site = new site(some uri))
{
using(SPWeb web = site.RootWeb)
{
SPList list = web.Lists["SomeList"];
SPListItem item = list.GetItemById(1); // Exception Here, COM Exception
}
}
This does not work even when using RunWithElevatedPrivileges.
However, if the HttpContext.Current is set to null, before creating the SPSite, everything works fine.
Any pointersas to why this is happening will be very helpful.
Kind regards,