这是我的情况:
我有一个SharePoint服务器托管在域A上,我的机器托管在域B上。 域A和域B之间没有任何信任关系。
我正在尝试从我的机器访问位于域A上的SharePoint文档库。
现在,当我使用这段代码时:
ClientContext clientContext = new ClientContext(siteURL);
clientContext.Credentials = new System.Net.NetworkCredential(username,password,domain);
clientContext.ExecuteQuery();
我遇到了以下错误:
The remote server returned an error: (401) Unauthorized
我想知道是否有可能在没有彼此之间建立信任的情况下跨域访问SharePoint文档库?我能想到的唯一解决方案是我的计算机应该在域A上。
更新
我把我的计算机转移到了安装有SharePoint服务器的域A上。仍然在clientContext.ExecuteQuery();处遇到相同的错误。我不知道为什么,请帮忙解决。