Issues with Windows Management Infrastructure Library

  • Thread starter Thread starter doktorake
  • Start date Start date
D

doktorake

Guest
Hello together,


im trying to get going with the WMI and C#.
Im working with the following Docs / Refs:

Enumerating WMI - Win32 apps

my code is simple and mostly taken from the url: View Paste IkrmK

When running the code on my Windows 8 Desktop, it goes fine and gives the desired output.
However, when running this on my current Desk, which is windows 10 i get the following exception:


System.TypeInitializationException

HResult=0x80131534

Nachricht = The type initializer for 'Microsoft.Management.Infrastructure.Native.OperationCallbacks' threw an exception.

Quelle = Microsoft.Management.Infrastructure.Native

Stapelüberwachung:

at Microsoft.Management.Infrastructure.Native.OperationCallbacks..ctor()

at Microsoft.Management.Infrastructure.Options.Internal.OperationOptionsExtensionMethods.GetOperationCallbacks(CimOperationOptions operationOptions)

at Microsoft.Management.Infrastructure.Options.Internal.OperationOptionsExtensionMethods.GetOperationCallbacks(CimOperationOptions operationOptions, CimAsyncCallbacksReceiverBase acceptCallbacksReceiver)

at Microsoft.Management.Infrastructure.CimSession.QueryInstancesCore(String namespaceName, String queryDialect, String queryExpression, CimOperationOptions options, CimAsyncCallbacksReceiverBase asyncCallbacksReceiver)

at Microsoft.Management.Infrastructure.CimSession.<>c__DisplayClass61_0.<QueryInstances>b__0(CimAsyncCallbacksReceiverBase asyncCallbacksReceiver)

at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumerableBase`2.GetEnumerator()

at MSTest_ng.HWSpecs..ctor() in C:\Users\DK\Source\Repos\test_ng\MSTest_ng\Program.cs:line 51

at MSTest_ng.Test.Main(String[] args) in C:\Users\DK\Source\Repos\test_ng\MSTest_ng\Program.cs:line 15

Innere Ausnahme 1:

MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.




anybody has an idea, why this happens and how to solve that?

Thank you!

Continue reading...
 
Back
Top