我在c#中写了一个实用程序,将文件从网络目录复制到SharePoint文档库。当系统管理员尝试从非SharePoint服务器运行.exe时,他获取以下错误:

未处理的例外:system.io.filenotfoundException:无法加载文件或装配'microsoft.sharepoint.client,Vers ION= 14.0.0.0,文化=中立,PublicKeyToken= 71E9BCE111E9429C'或其依赖项之一。系统找不到f 指定了。 文件名:'Microsoft.SharePoint.client,Version= 14.0.0.0,Culture= Neutral,PublicKeyToken= 71E9BCE111E9429C' 在spfileupload.program.main()

WRN:关闭绑定日志记录已关闭。 要使装配绑定失败记录,请设置注册表值[hklm \ software \ Microsoft \ Fusion!EnableLog](DWORD)到1。

是否有一种方法可以在我的.exe中包含组件,以便它将正常运行?

编辑:我正在使用sharepoint 2010 客户端对象模型

有帮助吗?

解决方案

Instructions on how to deploy the SharePoint 2010 Client Object Model assemblies can be found in Client Object Model Distribution and Deployment

Microsoft SharePoint Foundation 2010 installs Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI for easy access in development. You must have both Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll to develop a solution remotely with the .NET managed object model. For a Windows Forms, Windows Presentation Foundation (WPF), or other application that calls the .NET managed SharePoint Foundation client APIs, to function, the client computer must have the SharePoint Foundation client DLLs installed. The client DLLs must be distributed with the application by using Microsoft's SharePoint Foundation 2010 Client Object Model Redistributable.

其他提示

Please Use NuGet Package Manager to add DLLs to your projectenter image description here

许可以下: CC-BY-SA归因
scroll top