PowerCLI does not work when another product installed a log4j in the Global Assembly Cache
search cancel

PowerCLI does not work when another product installed a log4j in the Global Assembly Cache

book

Article ID: 337791

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • You receive an error if you have installed the SAP Crystal Reports runtime engine for .NET Framework and attempt to start the 64-bit version of PowerCLI.
  • You see error similar to "Could not load file or assembly ‘log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304’ or one of its dependencies. The system cannot find the file specified."


Environment

VMware vSphere PowerCLI 6.0

Cause

This issue occurs due to a log4net assembly in the GAC.
PowerCLI ships a log4net assembly in the "Modules\VMware.VimAutomation.Sdk" folder. The log4net assembly is explicitly loaded by the PowerShell because it is in the RequiredAssemblies list of the VMware.VimAutomation.Sdk.psd1 module manifest (see VMware.VimAutomation.Sdk.psd1).

SAP Crystal Reports runtime engine for .NET Framework installs a different version of the log4net assembly in the GAC that causes PowerCLI module loading to fail.

Resolution

To resolve this issue:
  1. Uninstall "SAP Crystal Reports runtime engine for .NET Framework".
  2. Use Windows PowerShell (x86) version instead of the 64bit version.