.net - FileNotFoundException with the SPSite constructor -


i try instantiate instance of spsite on farm server in custom process (myapp.exe) , give parameter whole uri (http://mysite:80/). made sure account running myapp.exe site collection administrator.

however, can't make instance of spsite whatever trying do. throws filenotfoundexception.

anyone got idea?

stacktrace:

at microsoft.sharepoint.spsite..ctor(spfarm farm, uri requesturi, boolean contextsite, spusertoken usertoken)
@ microsoft.sharepoint.spsite..ctor(string requesturl) @ mycompanyname.service.helperclass.getitemstateinsharepoint(sharepointitem item) in c:\workspaces\mycompanyname\development\main\mycompanyname.sharepoint\service\helperclass.cs:line 555

another side note... have web application + site collection can access through browser without problem.

the filenotfoundexception thrown sharepoint when cannot find requested site collection in sharepoint configuration database. guess have not yet created site collection on url http://mysite:80. see following stack trace if try , instantiate new spsite object url of non-existing site collection:

system.io.filenotfoundexception : site http://server/sites/bah not found in web application spwebapplication  name=sharepoint - 80 parent=spwebservice. @ microsoft.sharepoint.spsite..ctor(spfarm farm, uri requesturi, boolean contextsite, spusertoken usertoken) @ microsoft.sharepoint.spsite..ctor(string requesturl) 

specify proper url of site collection or open central administration , create new site collection.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -