Utiliser l'utilitaire SharePoint sur le serveur non-SharePoint
-
10-12-2019 - |
Question
J'ai écrit un utilitaire en C # pour copier des fichiers d'un répertoire réseau à une bibliothèque de documents SharePoint. Lorsque l'administrateur SYS tente d'exécuter le .exe d'un serveur non-SharePoint, il obtient l'erreur suivante:
Exception non gérée: System.IO.FilenotFoundException: Impossible de charger le fichier ou l'assemblage 'Microsoft.SharePoint.client, vers Ion= 14.0.0.0, Culture= neutre, PublickeyToken= 71E9BCE111E9429C 'ou l'une de ses dépendances. Le système ne peut pas trouver le F Ile spécifié. Nom de fichier: 'Microsoft.SharePoint.client, version= 14.0.0.0, Culture= neutre, PublickeyToken= 71E9BCE111E9429C' à SPFILEUPLOAD.PROGRAM.MAIN ()
WRN: L'ensemble de la liaison de montage est désactivé. Pour activer la journalisation de défaillance de liaison de montage, définissez la valeur de registre [HKLM \ Software \ Microsoft \ Fusion! Enablogog] (DWORD) à 1.
Y a-t-il un moyen d'inclure l'assemblage dans mon .exe pour qu'il fonctionne correctement?
Edit: J'utilise le SharePoint 2010 modèle d'objet client .
La 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.
Autres conseils
Please Use NuGet Package Manager to add DLLs to your project