locked
MSXML6 deadlock when used inside WCF service on Windows7 64bits RRS feed

  • Question

  • Hi all,

    I have a C# WCF service which is loading a native component. Interaction with native code are done via P/Invoke. LoadLibrary occurs on the main thread when the host is created.

    In that native component, there is a call to MSXML2::DOMDocument60::load to read a config file.

    It appears that this call always deadlock inside MSXML itself. Looking at the stack trace shows a lot of calls inside MSXML6.dll, ole232.dll and rpc4.dll.

    Note1 : The same code runs fine form a native executable.
    Note2 : Calling CoInitialize(NULL) from the native code return RPC_E_CHANGED_MODE
    Note3 : This only happens under Windows7 64bits (I am using SP1). It works on Windows7 32bits on Windows XP 32bits

    I found the following (old) article (kb815112) and a more detailed discussion here

    Those articles are quite old, I wonder if this is still applicable with MSXML6.

    Thanks
    Tuesday, November 22, 2011 11:15 AM

Answers

  • I found that the call the MSXML2::DOMDocument60::load occured in the LoadLibrary scope. This is bad practice because it can prevent the DLL from loading if the file does not exist.

    I moved that code out of the LoadLibrary scope and it works fine now. It is strange that the behaviour is different on Win7 64 bits.

    Anyway, I would be very interested in an updated status about compatibility between MSXML6 and tdotNet framework 4.

     

    • Marked as answer by Paul Zhou Wednesday, November 30, 2011 8:20 AM
    Wednesday, November 23, 2011 9:05 AM
  • You can read Microsoft XML team's blog:

    Upgrading to MSXML 6.0

     

    Hope it is useful for you.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Paul Zhou Wednesday, November 30, 2011 8:20 AM
    Wednesday, November 23, 2011 9:26 AM

All replies

  • I encountered the same problem using a Windows 7 64bit, Intel processor, machine;however, I replaced the processor with AMD...runs great!~Christine.
    Christine Sindelar
    Tuesday, November 22, 2011 2:20 PM
  • I found that the call the MSXML2::DOMDocument60::load occured in the LoadLibrary scope. This is bad practice because it can prevent the DLL from loading if the file does not exist.

    I moved that code out of the LoadLibrary scope and it works fine now. It is strange that the behaviour is different on Win7 64 bits.

    Anyway, I would be very interested in an updated status about compatibility between MSXML6 and tdotNet framework 4.

     

    • Marked as answer by Paul Zhou Wednesday, November 30, 2011 8:20 AM
    Wednesday, November 23, 2011 9:05 AM
  • You can read Microsoft XML team's blog:

    Upgrading to MSXML 6.0

     

    Hope it is useful for you.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Paul Zhou Wednesday, November 30, 2011 8:20 AM
    Wednesday, November 23, 2011 9:26 AM