Gary
Gary

Reputation: 1774

WMI C# - Receiving error - "Error getting disk drive instances"

I am receiving the following error when performing a WMI query in a C# program. The query in the program that worked just last week. In fact it just stopped working in the last few days. The only change to the system was the installation of DropBox which I've uninstalled with no change.

This is an informational message Error getting disk drive instances:
[12:41:00 PM] Gary Monk: Log Name:      Application
Source:        GuruService
Date:          3/9/2015 3:05:11 PM
Event ID:      0
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      JimsTablet
Description:
3/9/2015 3:05:11 PM
Error getting disk drive instances: System.Management.ManagementException:   Not found 
    at   System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObject.Initialize(Boolean getObject)
   at System.Management.ManagementBaseObject.get_ClassName()
   at System.Management.ManagementClass.GetInstances(EnumerationOptions     options)
   at System.Management.ManagementClass.GetInstances()
   at RealityEngineering.Licensing.GuruLicenseProvider.AppendHDDInfo(StringBuilder sb)

The hard drive has only about 2.3GB of free space but I wouldn't think that should make a difference when doing a query. Also this is a Microsoft Surface 1, that also shouldn't make a difference, but...

Does anyone know why this error occurs?

Thanks, Gary

Upvotes: 1

Views: 255

Answers (1)

bokibeg
bokibeg

Reputation: 2142

I've had similar error happening out of the blue with WMI, related to USB devices. It happened on an EPOS machine which is carbon-copy (exact image) of the other roughly about 2 000 machines. I never figured out what caused it but this fixed it, I also remember that one of the comments in that article contains some critical info.

Sorry for lack of more info, hope this helps you. I myself wasted about 5 hours on the WMI-going-bonkers-for-no-reason issue.

Upvotes: 2

Related Questions