我试图在自定义进程( SPSite )中的农场服务器上实例化一个MyApp.exe实例,并将其作为参数给出整个URI (http://mysite:80/)。我还确保运行MyApp.exe的帐户是Site Collection Administrator。
但是,无论我想做什么,我都不能创建SPSite的一个实例。它总是抛出一个FileNotFoundException。
有人想到办法了吗?
StackTrace:
at Microsoft.SharePoint.SPSite..ctor(SPFarm场场,Uri requestUri,布尔contextSite,SPUserToken userToken)
在MyCompanyName.Service.HelperClass.GetItemStateInSharePoint(SharePointItem项目处的C:\Workspaces\MyCompanyName\Development\Main\MyCompanyName.SharePoint\Service\HelperClass.cs:line 555中的Microsoft.SharePoint.SPSite..ctor(字符串requestUrl)
另一个旁注..。我有一个Web应用程序+站点集合,我可以通过浏览器访问它,没有任何问题。
发布于 2008-11-05 19:42:44
当FileNotFoundException在SharePoint配置数据库中找不到请求的站点集合时,它将由SharePoint抛出。我猜你还没有在URL http://mysite:80上创建一个站点集合。如果我尝试使用不存在的站点集合的URL实例化一个新的SPSite对象,我会看到以下堆栈跟踪:
System.IO.FileNotFoundException : The site http://server/sites/bah could not be found in the Web application SPWebApplication
Name=SharePoint - 80 Parent=SPWebService.
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(String requestUrl)指定站点集合的正确URL或打开“中央管理”,并创建新的“网站集”。
发布于 2010-10-05 20:02:03
将构建属性中的平台目标更改为x64在SharePoint 2010上为我解决了这个问题。
发布于 2009-10-07 07:29:02
阅读本网站http://community.bamboosolutions.com/forums/t/8179.aspx,如果您正在运行您的操作系统x64位,并且正在使用MSTest (32位),它将失败,使用nunit!
https://stackoverflow.com/questions/266255
复制相似问题