VMware Cloud Community
OON1
Contributor
Contributor

Get-Cluster System.MissingMethodException

Hello all,

I try to use Get-Cluster through System.Management.Automation powershell in C#.

However, after upgrading to .NET Framework 4.8 i get the following error

ExceptionGet-Cluster Exception has been thrown by the target of an invocation. System.Exception {VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.VimException}

With the innerexception being

InnerException Method not found: 'VMware.Vim.ClusterCryptoConfigInfo VMware.Vim.ClusterConfigInfoEx.get_CryptoConfig()'. System.Exception {System.MissingMethodException}

Does anyone know how to get around this?
Powershell version: 5.1.14393.4583

PowerCLI version: 12.4.0

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

PowerCLI is apparently not the only app experiencing this problem with .Net 4.8.x.
See for example the following Moq #Issue566
From that (long) issue it is not clear to me if it is actually a .Net 4.8.x issue or not.

The PowerCLI Dev team might want to look into this.
I suggest you open an SR.
But be aware that you will need a Developer Support contract to be able to open such an SR.

You could try the fix the Moq people seem to have given in point 3 in one of the comments.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
AtanasAtanasov
VMware Employee
VMware Employee

Can you share the installed versions of the PowerCLI modules?

For example:

Get-Module VMware.* | select name, version

 

It looks like the VMware.Vim module might be outdated and for some reason our version requirements is not reporting an error when loading the module.

Consider reinstalling PowerCLI (e.g. deleting all the PowerCLI modules from the modules folder and installing again).

OON1
Contributor
Contributor

Here is the output from that command

Name Version
---- -------
VMware.VIM 7.0.2.18627059
VMware.VimAutomation.Cis.Core 12.4.0.18627057
VMware.VimAutomation.Common 12.4.0.18627061
VMware.VimAutomation.Core 12.4.0.18627056
VMware.VimAutomation.Sdk 12.4.0.18627054

Should be up to date or am I wrong, @AtanasAtanasov ?

I have reinstalled PowerCLI last week, just before upgrading to .NET 4.8.

This issue only occurs when using the System.Managemet.Automation, however. If I execute the commands using ISE there are no problems.

Reply
0 Kudos
AtanasAtanasov
VMware Employee
VMware Employee

Check that your loading the correct assemblies. Try to attach a debugger and see from what file location the VMware.Vim.dll is loaded from and if it is from that module or from another location. Seems like you the loading mechanism is different for your case.

Reply
0 Kudos