I have simple Windows Service (Topshelf) written in .NET. When I try to use ManagementObjectSearcher (specifically to search connected disk drives) I get error:
The specified service does not exist as an installed service. (Exception from HRESULT: 0x80070424)
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
searcher.Get())
Everything else works fine (eg. using repository to access DB), only fails on this.
User contributions licensed under CC BY-SA 3.0