none
Building add-ins installer when using MSXML2 reference. RRS feed

  • Question

  • Hi;

    I wrote an add-ins in Visual studio 2010 and I build an installer to deploy it on Excel 2010. Things used to work fine until I add a reference for Excel object (Interop.MSXML2).

    Since then, I am no longer able to deploy it. Excel always crash.  any ideas ? do I need to add the reference within Excel as dll first ?

    Thank you in advance!

    Brice

    • Moved by CoolDadTx Monday, September 29, 2014 4:12 PM Office related
    Monday, September 29, 2014 10:21 AM

Answers

  • Well. Excel does support the MSXML2. you need to add the dll from C:\Windows\System32\msxml3.dll or C:\Windows\SysWOW64\msxml6.dll as a reference.

    Then I changed the load behavior in the register from 3 to 2 (less constraining) and it works now fine.

    Thursday, October 2, 2014 2:44 PM

All replies

  • Hi,

    >>until I add a reference for Excel object (Interop.MSXML2).<<

    How do you add the reference in the VSTO add-in project and deploy? As far as I know, Interop.MSXML2 is not an Excel Object. MSXML is a Microsoft’s COM-based XML parser and not related to Excel. But after researching, I find that Microsoft does not support the use of MSXML in .NET applications.

    MSXML uses threading models and garbage-collection mechanisms that are not compatible with the .NET Framework. Using MSXML in .NET applications through COM interoperability can result in unexpected problems that are difficult to debug. Microsoft does not recommend or support directly instantiating and using MSXML objects in .NET code, nor does Microsoft recommend or support marshalling MSXML interface pointers across the interop boundary.(From The use of MSXML is not supported in .NET applications)

    >>do I need to add the reference within Excel as dll first ?<<

    No, I don't think so. Excel supports XLL files to be added directly and I don't think Interop.MSXML2 can be added.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, September 30, 2014 7:25 AM
    Moderator
  • Well. Excel does support the MSXML2. you need to add the dll from C:\Windows\System32\msxml3.dll or C:\Windows\SysWOW64\msxml6.dll as a reference.

    Then I changed the load behavior in the register from 3 to 2 (less constraining) and it works now fine.

    Thursday, October 2, 2014 2:44 PM