may be you got error with .NET framework 4.0 with sharepoint 2010
checkout following link, says Sharepoint 2010 not yet supported by .NET framework 4.0
hope it helps
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
.Net 3.5 with sharepoint 2010 will give you good results.