Saturday, October 16, 2010

Error : The Web application at [URL] could not be found. Verify that you have typed the URL correctly.

While developing console applications for SharePoint 2010 in Visual Studio 2010, I face FileNotFoundException when I use SPSite object i.e. using(SPSite site = new SPSite(url)).

System.IO.FileNotFoundException was unhandled
  Message=The Web application at http://intranet.maarktech.com 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.
  Source=Microsoft.SharePoint.

Error

This is because in my Project Properties, Build target platform was set as x86.

ProjectSetting 

When I changed my target platform back to Any CPU, it starts running well.

ApplicationRunning

No comments:

Post a Comment