Error "Connect-VIServer : Could not load file or assembly 'VMware.Vim" after install/upgrade to VMware Power-CLI 11.2
search cancel

Error "Connect-VIServer : Could not load file or assembly 'VMware.Vim" after install/upgrade to VMware Power-CLI 11.2

book

Article ID: 314240

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • You are not able to connect to vCenter after installing PowerCLI version 11.2
  • Un-installing and re-installing PowerCLI does not resolve the issue.
When you try to connect to the vCenter from the management server with PowerCLI this error may be displayed: 

Connect-CisServer Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

Or; 
 
Could not load file or assembly 'VMware.Vim, Version=6.7.0.1825, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Cause

VMware PowerCLI 11.2 is installed in the following location "C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Common\11.2.0.12483627\net45",

However the default install location for earlier releases of PowerShell is C:\Windows\System32\WindowsPowerShell\v1.0. During the connect to vCenter PowerShell searches for the  "Newtonsoft.Json.dll" which is installed in the default PowerCLI location.

Resolution

Currently there is no resolution.

Workaround:
To workaround this issue copy the Newtonsoft.Json.dll from C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Common\11.2.0.12483627\net45 to  C:\Windows\System32\WindowsPowerShell\v1.0.