When we add any reference dlls(say in the example Microsoft.SharePoint.Client dll) in Office 2010 addin and package it using Click once and install it in client machine it gives an
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
at WordAddIn1.Form1.UploadDocument(Byte[] docbytes)
at WordAddIn1.Form1.button1_Click(Object sender, EventArgs e)
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\PROGRA~1\MICROS~2\Office14\WINWORD.EXE
Fix:
Add the reference dlls in the root of the project like below and publish again. This took me a day to figure out :(.
There were no good article to debug and fix this issue in msdn forums so thought this might be useful to someone
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
at WordAddIn1.Form1.UploadDocument(Byte[] docbytes)
at WordAddIn1.Form1.button1_Click(Object sender, EventArgs e)
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\PROGRA~1\MICROS~2\Office14\WINWORD.EXE
Fix:
Add the reference dlls in the root of the project like below and publish again. This took me a day to figure out :(.
There were no good article to debug and fix this issue in msdn forums so thought this might be useful to someone