gpt4 book ai didi

sharepoint - 带有 SPSite 构造函数的 Sharepoint 2010 的 FileNotFound 异常

转载 作者:行者123 更新时间:2023-12-03 11:17:42 24 4
gpt4 key购买 nike

我尝试在控制台应用程序中的场服务器上实例化 SPSite 实例,并在参数中提供整个网站 ( http://sp2010/ )。我还确保运行 MyApp.exe 的帐户是网站集管理员。

但是,无论我想做什么,我都无法创建 SPSite 的实例。我总是返回“FileNotFoundException”。

有人有想法吗?

堆栈跟踪:

System.IO.FileNotFoundException: The Web application at http://localhost/sandbox 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 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



当我使用 App Pool Identity 帐户运行此应用程序时,它工作正常。但是,当我使用不同的用户(即网站集管理员)运行此控制台应用程序时,场管理员对 Sharepoint Web 应用程序的内容数据库拥有 dbowner 权限。

控制台应用程序使用 .Net Framework 3.5 和 x64 作为 CPU 平台。
如果我使用应用程序池身份帐户,这同样有效,但不适用于任何其他帐户

最佳答案

运行控制台应用程序的用户至少需要对 SharePoint 数据库具有读取权限,否则您将看到此类错误

关于sharepoint - 带有 SPSite 构造函数的 Sharepoint 2010 的 FileNotFound 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3775033/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com