I am trying to create an SPSite instance on a farm server in a console application, and I give the whole site in the parameter ( http: // sp2010 / ). I also made sure that the account MyApp.exe is running on is the Site Collection Administrator.
However, I cannot make the SPSite instance what I'm trying to do. I always return a "FileNotFoundException".
Anyone got an idea?
Stacktrace:
System.IO.FileNotFoundException: web application http: // localhost / sandbox not found. Make sure you type the URL correctly. If the URL must serve existing content, the system administrator may need to add a new URL for the intended application. in Microsoft.SharePoint.SPSite..ctor (farm SPFarm, Uri requestUri, Boolean contextSite, SPUserToken userToken) in Microsoft.SharePoint.SPSite..ctor (String requestUrl) in Conchango.xyzzy.GetExistingDocument (String minId, String maxId, String titleFilter ) in C: \ Documents and Settings \ Paul \ My Documents \ Visual Studio 2005 \ Projects \ xyzzy \ BDC_DocReview \ BDC_DocReview \ DocReviewFacade.asmx.cs: line 69
When I run this application using the application pool id account, it works fine. However, when I launch this console application using another user who is the Site Collection Administrator, Admin Admin, has dbowner privileges in the content database for the Sharepoint web application. This does not work correctly and gives me this Filenot Founf Exception.
The Console application uses the .NET Framework 3.5 and x64 as the CPU platform. Again this works if I use an application pool id account but not with any other account
source
share