System.IO.FileNotFoundException: The Web application at http://localhost 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
If you get the above error while opening a site through an SPSite object while performing a unit test in Visual Studio 2010, a simple resolution is to update the test engine settings to run in a 64 bit process.
To do this, highlight the test project in the Solution Explorer and from the Test menu, select Edit Test Settings -> Local (local.testsettings).
Next, select Hosts from the left hand pane and change the Run tests in 32 bit or 64 bit process: to Run tests in 64 bit process on 64 bit machine.
Thanks buddy !! I tried to change it but it still throwing an error
Microsoft SharePoint is not supported with version 4.0.30319.1008 of the Microsoft .Net Runtime.
What version of the .Net framework is the unit test project configured to use?