Click or drag to resize

Assemblies exception

Example: when run a PowerShell command.

PowerShell
PS C:\Windows\system32> Connect-VIServer -Server 172.16.99.90 -User [user name] -Password [password]
Connect-VIServer : Die Datei oder Assembly "VMware.Security.CredentialStore, Version=11.5.0.2523, Culture=neutral, 
PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
At line:1 char:1
+ Connect-VIServer -Server 172.16.99.90 -User  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer
Problem

The application can't access the right version of assembly. Although the assembly exists and right installed.

Reason

Assemblies are same name but different version. Same where installed into GAC.

Example: assembly DLL VMware.Security.CredentialStore.dll install from Microsoft PowerShell module VMware.PowerCLI and from SOWI VMInfoFace application (into GAC).

Solution

In PowerShell install the explicit conflict assembly. Example:

Command: Import-Module -Name '%ProgramFiles%\WindowsPowerShell\Modules\VMware.VimAutomation.Sdk\11.5.0.14898111\net45\VMware.Security.CredentialStore.dll'

Details see PowerShell

See Also

Other Resources