Skip to content

WMI is terrible #749

@nxtn

Description

@nxtn

Same as #204

Just found that 2.x completely doesn't work on my machine due to WMI failure. The 'Windows Management Instrumentation (Winmgmt)' service is running. Have tried to restart Windows. 3.x is working properly.

Steps to reproduce

> WinSW.exe /?
0000-00-00 00:00:00,000 FATAL - Unhandled exception
System.Management.ManagementException: Generic failure
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)
System.Management.ManagementException: Generic failure
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)

Environment

  • WinSW version: 2.10.3/2.3.0
  • WinSW package type: .NET 4.6.1/4.0
  • Windows version: Windows 10, version 20H2

Possible Solution

Switch to use native Win32 APIs like in 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions