SPSite: The Web application could not be found
You’re trying to use the SharePoint 2010 server side API’s but you’re getting the exception:
The Web application at https://... 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.
Then the root cause is probably not:
-Misconfigured AAM
-Missing App. Pool permissions
It is probably that you’re compiling for x86 platform target.
Change that to x64 and your code will probably work:
-thomas
Comments
Anonymous
October 06, 2010
The comment has been removedAnonymous
October 18, 2010
Amen to that - a classic misleading error message. Thanks for stopping me chasing my tail.Anonymous
December 01, 2010
Hi thompal, Actually I want to create an window application to add the data to the custom list programatically. To get the Site collection obeject, I have written the following code: using (SPSite siteColl = new SPSite("http://inkolsaljnj0503/sites/SP2010-Testing/")) But I have facing the same problem. Please help me regarding this.Anonymous
May 27, 2013
If you are in development / debug mode, you may need to run Visual Studio 2010/2012 in Administrator Mode.