SPSite - FileNotFoundException

You may be writing a consoleapp that uses the SPSite object. You write something like:

SPSite site = new SPSite("http://yourSiteHere");

Running the code produces the following error:

The Web application at http://yourSiteHere 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 inteded application.

You may need to go to your Solution properties and select Any CPU. If one doesn't exist, you can make a copy of an existing platform to create it.

Labels: