Title: Error(s) while running SharePoint 2010 projects using Visual Studio 2010
Details: Have you encountered the below errors while you are running SharePoint 2010 projects using Visual Studio 2010?
System.IO.FileNotFoundException was unhandled by user code
Message="The Web application at http://sp2010/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application."
Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=22.214.171.124, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.
Resolution: Verify what framework you are running against. By default Visual Studion 2010 runs with .NET Framework 4.0 and SharePoint 2010 is built against to run on .NET Framework 3.5.
Change you project settings to run against 3.5 and you should be good