在windows服务中打开spweb
本文关键字:spweb windows 服务 | 更新日期: 2023-09-27 18:06:30
我想检查SharePoint库中的文档属性。请告诉我如何在windows服务中打开SharePoint网站。我在windows服务中使用以下代码,它给出"站点未发现错误"。
SPSite spSite = new SPSite("http://xyz/sites/abc");
Detail Error is,
System.IO.FileNotFoundException: The Web application at http://xyz/sites/abc 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.
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
at 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
你的代码没问题。
您确定http://xyz/sites/abc
是站点吗?URL是否正确?
如果URL是正确的,那么检查你是否有必要的权限来打开它。
编辑:请检查此线程:SharePoint错误:Web应用程序在xxxx无法找到