c# - Open spweb in windows service -


i want check documents properties in sharepoint library. please tell me how open sharepoint website in windows service. using following code in windows service, gives "site not found error".

spsite spsite = new spsite("http://xyz/sites/abc"); 

detail error is,

system.io.filenotfoundexception: web application @ http://xyz/sites/abc not found. verify have typed url correctly. if url should serving existing content, system administrator may need add new request url mapping intended application.    @ microsoft.sharepoint.spsite..ctor(spfarm farm, uri requesturi, boolean contextsite, spusertoken usertoken)    @ microsoft.sharepoint.spsite..ctor(string requesturl)    @ ssp_dl_notify_service.service1.getmail(object sender, elapsedeventargs args) in c:\users\pqr\documents\visual studio 2010\projects\ssp_dl_notify_service\ssp_dl_notify_service\service1.cs:line 54 

your code fine.

are sure http://xyz/sites/abc site? url correct?

if url correct check if have required permissions open it.

edit:

check thread also: sharepoint error: web application @ xxxx not found


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -