Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Accessing legacy MSXML2 Interop DLL fails 16 Mar 2022 12:32 #21957

  • Jan
  • Jan's Avatar
  • Topic Author


  • Posts: 5
  • Hello,

    we are currently migrating a project from Vulcan.Net to XSharp. It is containing a reference to the legacy Microsoft XML 6 DLL Interop.MSXML2.DLL.

    In the migrated X# project, there is an MSXML2 (Microsoft XML 6, DLL name: Interop.MSXML2.dll) reference, and Intellisense does offer the members when I am typing MSXML2..

    Nevertheless, the compiler throws an error:
    XS0246	The type or namespace name 'MSXML2' could not be found (are you missing a using directive or an assembly

    Does anybody know how to access MSXML2 in X#?

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 16 Mar 2022 14:36 #21961

    • robert
    • robert's Avatar


  • Posts: 3599
  • Jan,
    This sounds like a "USING " statement is missing.
    What is the complete type name for the MSXML2 class ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 09:31 #21962

    • Jan
    • Jan's Avatar
    • Topic Author


  • Posts: 5
  • Thank you, but I am using #USING already.

    There is no difference whether I am writing #USING or putting "MSXML2." (or both) in front of the corresponding Object, though MSXML2 is the correct namespace, because that namespace worked in Vulcan.NET.

    I made a screenshot, see attachment of this post with intellisense tooltip showing the members.
    I am a bit confused about that...

    XSharp Version is Cahors 2.9.1.1
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by Jan.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 09:52 #21963

    • Chris
    • Chris's Avatar


  • Posts: 3981
  • Hi Jan,

    Please check also the warnings reported by the compiler, can you spot one or more related to the COM reference?
    I gave it a short try here and I see that I get some warnings about failing to create a wrapper assembly for it, which is what I guess causes the problem.
    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 10:55 #21964

    • Jan
    • Jan's Avatar
    • Topic Author


  • Posts: 5
  • I'm getting two warnings:
    MSB3305	Processing COM reference "MSXML2" from path "C:\Windows\SysWOW64\msxml6.dll". At least one of the arguments for 'ISAXXMLReader.getBaseURL' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    MSB3290	Failed to create the wrapper assembly for type library "MSXML2". Access to the path 'obj\Debug\Interop.MSXML2.dll' is denied.

    The file exists and isn't write protected.

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 11:07 #21965

    • FFF
    • FFF's Avatar


  • Posts: 1419
  • It says "to the path", not "to the file" - do you have the necessary access rights?
    Regards
    Karl (X# 2.15.0.3; Xide 2.15; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 13:23 #21967

    • Jan
    • Jan's Avatar
    • Topic Author


  • Posts: 5
  • I removed the reference and added a new reference to C:\Windows\SysWOW64\msxml6.dll instead, and now it is working.

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 17 Mar 2022 22:00 #21970

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Hello Jan,

    FWIW, you may have your reasons to use MSXML2 since you are using X#, why not use System.Xml namespace and classes?
    They are well documented and built in the NET framework

    Jamal

    Please Log in or Create an account to join the conversation.

    Accessing legacy MSXML2 Interop DLL fails 08 Mar 2023 14:45 #25556

    • mk_schmid
    • mk_schmid's Avatar


  • Posts: 6
  • Hello,
    the use of MSXML is not supported in .NET applications.
    learn.microsoft.com/de-DE/troubleshoot/w...t-dotnet-application
    I think you have to change to System.xml!

    Christian
    Christian Schmid

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1