Skip to main content

System.IO.FileNotFound exception in SharePoint 2010

Sharepoint 2010 works comes certain constrains to improve the performance.So when we start working with 2010 it will be intresting to see some error which normally works in sharepoint 2007.

For example if you ran into issue like System.IO.FileNotFound exception. You will wonder why its not working just executing four lines of code like follow


using (SPSite objSiteColl = new SPSite("http://localhost"))
{
         Console.WriteLine("Found Site : {0}", objSiteColl.RootWeb.Title);
}

Here we just forgot that Sharepoint 2010 support only 64 bit , answer is simple Go to project properties and change platform to X64.

Still not over yet same could be raised by the permission Issue read  my other blog and see minimal permission required to execute the code which access the sharepoint Object Model.

If you use .Net framework 4.0 check my blog before using it.

Comments

Post a Comment