This project is read-only.
1
Vote

Bug in WMI Type provider: exception when instantiating Msvm_VirtualSystemManagementService

description

The WMI Type provider fails with an exception when trying to instantiate the HyperV WMI class Msvm_VirtualSystemManagementService.

Repro script
#r @"System.Management.dll"
#r @"fsharpsample\SampleProviders\Debug\net45\Samples.Management.TypeProvider.dll"
open Samples.Management.TypeProvider
open System.Management
type Local = WmiProvider<"localhost", @"root\virtualization\v2">
let local = Local.GetDataContext()
let hyperv = local.Msvm_VirtualSystemManagementService
Result
hyperv.fsx(7,14): error FS3021: Unexpected exception from provided type 'Samples.Management.TypeProvider.WmiProvider,MachineName="localhost",Namespace="root\\virtualization\\v2"+ServiceTypes+Msvm_VirtualSystemManagementService' member 'GetMethods': The type provider 'Samples.Management.TypeProvider.DesignTime.WmiExtender' reported an error: Not found 
> 
Source
The exception is thrown by the failwith at line 71 of file WmiProvider.DesignTime.fs
| CimType.Reference when tyName.StartsWith("ref:") ->
            if wmiProp.IsArray then
                failwith (sprintf "Unexpected type: %A array" wmiProp.Qualifiers.["cim_type"].Value)

comments