Always getting the following error while trying to create a spsite-object:
The Web application "http://myApplicationURL/" at 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.
The webservice should access the local SharePoint-Application which does work in a browser. First it seems like a common problem, but tried all the web-suggested solutions:
- compiling as "any platform" or x64
- using .Net 3.5
- starting as farm administrator / don't start as farm administrator
- trying the published version of the webservice instead of debugging in VS2010
- modifying: regedit DisableLoopBackCheck to 1, means I'm able to log in locally to the application/the other applications
- tried to access a different application on the same server -> same problem
- used elevated privileges
- starting VS2010 with "ADMIN"-Privileges
- adding the starting user (is farm admin) to WSS_ADMIN_WPG windows user group
- users are fully privileged on SQL content database
- users are site collection as well
what else could be wrong?
Here some code, it's simple as that:
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://test-sharepoint.myApp.local"))
{
}
}
}