Sharepoint SPS网站 [英] Sharepoint SPSite

查看:54
本文介绍了Sharepoint SPS网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为共享点搜索创建一个对象的 spsite,但由于未找到网站,我在生产中遇到异常

I am trying to create a spsite of object for sharepoint search but i am getting exception in production as website not found

SPSite site = new SPSite("sitename");
ServerContext scon = ServerContext.GetContext(site);
SearchContext srchcontext = SearchContext.GetContext(scon);
Scopes sc = new Scopes(srchcontext);

它抛出异常 site not found 我已经检查了它退出的站点的名称.

It throws exception site not found i have checked the name of site it exixts.

有什么帮助吗??

推荐答案

检查您是否针对正确的目标进行构建.IE.x86 与 x64.当我针对 x86 构建并尝试针对 x64 运行时出现此错误.

Check that you are building against the correct target. I.e. x86 vs x64. I get this error when I build against x86 and try and run against x64.

这篇关于Sharepoint SPS网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆