gpt4 book ai didi

c# - 无法加载文件或程序集 'Microsoft.SharePoint,版本 = 15.0.0.0

转载 作者:行者123 更新时间:2023-11-30 23:11:10 25 4
gpt4 key购买 nike

这是我使用的代码。我添加了 Microsoft.SharePoint.dll 。

using Microsoft.SharePoint.Client;
using System.Web.Script.Serialization;
using Microsoft.SharePoint;

class
{
SPSite site = new SPSite(siteUrl);
}

错误显示是这样的:

 Could not load file or assembly 'Microsoft.SharePoint, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies.
The system cannot find the file specified.

最佳答案

1) 检查项目中的引用。是否有 Microsoft.SharePoint 引用?

2) 如果有引用且未损坏,请通过打开库属性检查版本。

2.1) 如果你引用了较新的版本,请在应用配置中添加一个带有 bindingRedirect 的程序集绑定(bind),例如:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>

3) 启用 Fusion 日志 How to enable assembly bind failure logging (Fusion) in .NET并阅读日志。

关于c# - 无法加载文件或程序集 'Microsoft.SharePoint,版本 = 15.0.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44923698/

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