I'm attempting to upgrade a project to Dotnet Core 3 which uses System.Management for WMI calls. When connecting to my MangementScope:
var scope = new ManagementScope(@"\\computer\root\CIMV2", new ConnectionOptions());
Program dies with the exception:
An unhandled exception has occurred while executing the request.
System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter dotnet/corefx#3': Cannot marshal a string by-value with the [Out] attribute.
at System.StubHelpers.StubHelpers.ThrowInteropParamException(Int32 resID, Int32 paramIdx)
at System.Management.ManagementPath.GetWbemPath(IWbemPath wbemPath)
at System.Management.ManagementScope.set_prvpath(ManagementPath value)
at System.Management.ManagementScope..ctor(ManagementPath path, ConnectionOptions options)
I've seen the same Marshal exception on recent Core 3 preview posts that were supposedly fixed, but this issue seems to persist.
I'm attempting to upgrade a project to Dotnet Core 3 which uses System.Management for WMI calls. When connecting to my MangementScope:
var scope = new ManagementScope(@"\\computer\root\CIMV2", new ConnectionOptions());Program dies with the exception:
I've seen the same Marshal exception on recent Core 3 preview posts that were supposedly fixed, but this issue seems to persist.