Question

I wrote a utility in C# to copy files from a network directory to a SharePoint document library. When the sys admin tries to run the .exe from a non-SharePoint server, he gets the following error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client, Vers ion=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the f ile specified. File name: 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' at SpFileUpload.Program.Main()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Is there a way to include the assembly in my .exe so that it will run properly?

Edit: I'm using the SharePoint 2010 Client Object Model.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top