Hi,
I am working in a sharepoint 2010 development environment. The issue is whenever I run my code from VS2010 console application in the DEV server it works fine. But when I change the site url to my TEST instance i.e which has alternate access mapping (http://Companyname.com/mysite) throws exception.
string siteStr=@"http://servername/mysite"; //DEV sharepoint site works fine
string TsiteStr=@"http://Companyname.com/mysite"; //TEST sharepoint site gives exception.
using
(SPSite site =
new
SPSite(TsiteStr) //get FilenotFound Exception
{
using
(SPWeb web = site.OpenWeb())
{
}
}
please note that I am trying to access the TEST site from the VS2010 which is residing in DEV environment. I also confirm that my account has admin rights in entire TEST server farm and also TEST SP content and Config databases.
Not sure if the issue because of the alt access mapping site url of my test instance. I also checked several other threads related to the same issue but does not provide any resolution.
Please suggest how I should change my code.
Thanks.