System.Management.ManagementException: Invalid Class


  • During one of my applications running I try and find the volume number of the local hard drive using WMI. Here is my code:

    ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"C:\"");

    //Error happens here


    It only happens on 1 machine running Windows 2000. I can't get it to break any place else.

    Thursday, January 19, 2006 9:47 PM


  • Just a minor update:

    The person that had this happen uninstalled the application, removed the database, and then reinstalled the application and that fixed it. I am not sure why but I guess I can use that as a solution.

    Monday, January 23, 2006 10:46 PM