Skip to main content

System.PlatformNotSupportedException in Sharepoint 2010

All the sharepoint developer must be exited to see the .Net Framework 4.0 , unfortunately its not supported.Once you VS2010 and start playing around as sharepoint devleloper you just jump into start writing few lines of code.

May be something like following


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



 Exception  :

Exception of type 'System.PlatformNotSupportedException' was thrown.


   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm()


   at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)


   at Microsoft.SharePoint.Administration.SPFarm.get_Local()


   at Microsoft.SharePoint.SPSite..ctor(String requestUrl)


No need to scratch your head , .Net Framework 4.0 is not supported in Sharepoint.

Comments

Post a Comment