When we are doing a SharePoint deployment using PowerShell there we could find similar problem like that:
Cannot convert the “Microsoft.SharePoint.Client.ClientContext” value of type “Microsoft.SharePoint.Client.ClientContext” to type “Microsoft.SharePoint.Client.ClientRuntimeContext”.”
In my scenario I was trying to Activate a Sandboxed solution using PowerShell:
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl);
And I received the error mentioned before. I did some checks:
- Run as administrator
- Run using SharePoint Online PowerShell command line.
- Check I have installed Client Components.
But after some investigations, the reason is the version of SharePoint Client Components and SharePoint Online Management Shell I was using.
To solve it, Install latest version of them, uninstall previous versions and restart Powershell console.