Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMI provider: exception when instantiating Msvm_VirtualSystemManagementService #46

Open
blumu opened this issue Oct 13, 2014 · 1 comment

Comments

@blumu
Copy link

blumu commented Oct 13, 2014

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

Repro script
Install nuget package with

Install-Package FSharp.Management

Run the following under F# interactive (Note: it also reproes with a compiled .fs file).

#r @"System.Management.dll"
#r @"System.Management.WMI.dll"
open System.Management
open FSharp.Management
type Local = WmiProvider<"localhost", @"root\virtualization\v2">
let local = Local.GetDataContext()
let hyperv = local.Msvm_VirtualSystemManagementService

Result

C:\Users\wiblum\AppData\Local\Temp\stdin(4,1): error FS3021: Unexpected exception from provided type 'FSharp.Management.WmiProvider,MachineName="localhost",Namespace="root\\virtualization\\v2"+ServiceTypes+Msvm_VirtualSystemManagementService' member 'GetMethods': The type provider 'FSharp.Management.DesignTime.WmiExtender' reported an error: Not found 

Source
The exception is thrown by the failwith at line 73 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)

Note
Bug imported from fsprojects/FSharpx.Extras#269 also filed in F# Sample pack project at https://fsharp3sample.codeplex.com/workitem/2934.

@dsyme
Copy link
Contributor

dsyme commented Jun 5, 2015

@blumu - Any idea if there is a simple fix for this? DO we need better diagnostics here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants