Cannot install Microsoft.SharePointOnline.CSOM

Scenario:

Trying to install Microsoft.SharePointOnline.CSOM from Nuget.org

Steps to reproduce:

  • Open manage packages.
  • Select Nuget.org
  • Search for CSOM.
  • Click install after selecting Microsoft.SharePointOnline.CSOM by Microsoft.

Current Behavior:

Installation fails with the following message.

19.4.2+Branch.master.Sha.e17a3bedca2a7da0d0b716b5f8f765d1d5ef1ddc

The following package(s) can not be installed: 
Microsoft.SharePointOnline.CSOM 16.1.8810.1200

Cannot load assembly: C:\Users\UserName\.nuget\packages\microsoft.sharepointonline.csom/16.1.8810.1200\lib/net45/Microsoft.SharePoint.Client.Runtime.Windows.dll : System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime.Portable, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SharePoint.Client.Runtime.Portable, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at UiPath.Studio.Plugin.Workflow.Services.AssemblyContainer.AddAssemblyInternal(Assembly assembly, String path) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\AssemblyContainer.cs:line 224
   at UiPath.Studio.Plugin.Workflow.Services.AssemblyContainer.LoadAssemblies(String[] paths, IAppDomainCancellationToken cancellationToken) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Services\AssemblyContainer.cs:line 98

Expected Behavior:

Should install the package successfully.

Studio/Robot/Orchestrator Version:

Studio Version: 2019.4.2
OS Version: Windows 10

1 Like

Hi @KannanSuresh

Could you give this solution a try?
https://social.msdn.microsoft.com/Forums/en-US/1ba8411a-4795-4d05-b8ab-6cf34d2633cb/sharepointonlinecsom-missing-assembly?forum=sharepointdevelopment

Especially this post:

1 Like

Hi @loginerror,

Thanks a lot for the quick reply.

I am aware of this workaround. However, this is not practical if we need to deploy some custom activities involving this nuget package.

Another workaround would be to repackage it and use.

It seems this is not an issue with UiPath. However, please note, this issue occurs when I try installing it on UiPath. It works without issues if I use it in a C# solution in Visual Studio.

Hi, did you ever come up with a good solution for this problem?

No. As of now repackaging is the only option I see.

Thats was what i did, sad thing this nugget package seems to be bad and having wrong dependencies…

It was installed. Thanks for giving this solution.