FSharp.Management icon indicating copy to clipboard operation
FSharp.Management copied to clipboard

Specified method is not supported

Open sheganinans opened this issue 8 years ago • 0 comments

Description

Standard WMI interface works, but the type provider does not.

Repro steps

Given this code:

let test () =
    type Local = WmiProvider<"localhost">
    let wmi = Local.GetDataContext ()
    for e in wmi.Win32_PnPEntity do
        printfn "%s" e.Caption

At design time, there is no error and Intellisense works properly (Caption shows up in the suggestion list), however at compile time, there is this error:

Unexpected exception from provided type 'FSharp.Management.WmiProvider,MachineName="localhost"+ServiceTypes+Win32_PnPEntity' member 'GetMethods': The type provider 'FSharp.Management.DesignTime.WmiExtender' reported an error: Specified method is not supported.

However this works, if I use the low-level WMI interface:

let srch = new ManagementObjectSearcher ("SELECT * FROM WIN32_PnPEntity")
// etc...

As expected, the Captions are printed.

Related information

  • Operating system: Windows 10
  • Branch: 0.4.3 Master
  • .NET Runtime

sheganinans avatar Feb 17 '17 00:02 sheganinans