23 June 2010 0 Comments

The web application could not be found

Supposed you’re using the following:  - SharePoint Server 2010 or SharePoint Foundation 2010  - Visual Studio 2010  - .NET Framework 4.0 And you’re trying to instantiate an SPSite object for a specific site collection, using the SPSite constructor as follows: SPSite mySite = new SPSite(“http://testserver”); Now, although you’re 100% sure that the URL to the site collection is correct, and that everything is OK from all perspectives (authentication, authorization, etc.), you still get the following exception: System.IO.FileNotFoundException The web application at http://testserver 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

See more here: 
The web application could not be found

If you liked this post, buy me a Coffee.

Leave a Reply