none
ManagementObjectSearcher causes InteropServices.COMException (0x80070017) RRS feed

  • Question

  • Below is the exception:

    ManagementObjectSearcher causes InteropServices.COMException (0x80070017):Data error (cyclic redundancy check).(Exceptiofrom HRESULT: 0x8007007)

    at System.Management.ThreadDispatch.Start()

    at System.ManagementScope.Initialize()

    at System.ManagementObjectSearcher.Initialize()

    at System.ManagementObjectSearcher.Get()

     

    Do you have any idea what is causing this

    Thanks

    Running on windows XP

    VS2010 RTM

    .Net 3.5

    • Edited by pcy Saturday, October 23, 2010 4:09 AM Should be .Net 3.5 sp1 not 4
    Friday, October 22, 2010 9:34 AM

All replies

  •  

    Hi pcy,

     

    Thanks for your post.

     

    HRESULT: 0x8007007 means DSROLEEVT_REPLICATE_SCHEMA (Installing the Directory Service), so could you please recheck whether the Directory Service is install on the target machine.

     

    By the way, if will be helpful if you could provide more information about how to reproduce this issue, steps or some related code snippets are appreciated.


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, October 25, 2010 2:42 AM
  • I am calling the below function from the main winform in onload:  
     static public bool IsNetworkConnected() 
       {
                bool connected = false;

             
                ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_NetworkAdapter where NetConnectionStatus=2");
              
               int connectedNetworks = searcher.Get().Count;

                if (connectedNetworks > 0)
                {
                    connected = true;

                }

                return connected;
            }
    I am running the same application on a few PC . All is OK except one. 
    It will throw the above mention exception when the program startup
    Tuesday, October 26, 2010 8:06 AM
  • Can you run the query in WBEMTEST on the same machine, take the coding piece out and trouble shoot WMI itself to make sure that they are able to retrieve Win32_NetworkAdaptor classes in general. ( select * from win32_NetworkAdapter ) and see what comes back?


    This will insure that WMI is working OK.  Once we know WMI works and the class has instances, try the same query you are executing in code, make sure that works. 

     

    If both of these work, the WMI is working and it becomes an issue with the .Net framework wrapper.

     

    I did find some supporting evidence that this error is may not be related to WMI at all, but to the framework install.  It may be necessary to re-install the most recent version of the .net framework.

    Chris Cooper

    Thursday, November 4, 2010 9:58 PM