Friday, May 21, 2010

SharePoint 2010 Console Application threw FileNotFoundException was unhandled

My colleague called me and asked to look for the error she was getting in her first SharePoint 2010 Console Application.

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

Simple solution, Check to make sure thats Build Target for the Project is x64 and not x86 which is default setting.

1. Right Click the Project Node > Properties
2. Under Build tab > Target should be x64

Also make sure thats there is a site collection at the url you are specifying to create SPSite object


Mahmoud Hakeem May 23, 2010 at 3:48 PM  

Also make sure that the current account has full permissions to access the SharePoint configuration database