Issue with Microsoft.SharePoint.Client.RoleDefinitionBindingCollection


There seems to be some sort of type mismatching with the objects returned from the Get-SPOContext cmdlet and what/how Powershell is able to use it.
For example, PowerShell won’t cast the ClientContext to a ClientRuntimeContext even though the types say it should be an acceptable cast.

This resulted in the error:
(cannot find an overload for "Microsoft.SharePoint.Client.RoleDefinitionBindingCollection")


rufpoet wrote May 27, 2015 at 9:04 PM

This appears to be caused by some version mismatches with the SharePoint client assemblies.

The SPOCmdlets module is build against version 15. I am trying to use this in an environment that is using version 16. This is causing both sets of assemblies to be loaded and objects are being created from both assemblies. Calling a method on an object from one assembly and passing in an argument from the other assembly appears to be causing the cast issue.

Would it be possible to release a build of this module built against v16?

rufpoet wrote May 27, 2015 at 9:26 PM

Confirmed, rebuilding the module with the v16 versions of the SharePoint Client dlls resolves the issue.