all groups > dotnet interop > november 2005 >
You're in the

dotnet interop

group:

MSXML and COM Interop



MSXML and COM Interop DavidCoghlan
11/30/2005 7:10:06 AM
dotnet interop: Hi,

I came across the following KB article regarding the use of MSXML in .NET
applications:

http://support.microsoft.com/default.aspx?kbid=815112

It states that MS does not support either directly instantiating MSXML
objects in .NET code, or marshalling MSXML interface pointers across the
interop boundary.

I take it from this that there are no issues with using a COM object in .NET
that internally makes use of MSXML, so long as MSXML interfaces are not
exposed to the .NET world. Please could somebody 'in the know' confirm that
this is the case!

RE: MSXML and COM Interop v-phuang NO[at]SPAM online.microsoft.com (
12/1/2005 12:00:00 AM
Hi,

Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: MSXML and COM Interop DavidCoghlan
12/1/2005 2:31:03 AM
Thanks, Peter, I look forward to your response!

Regards,

David Coghlan

[quoted text, click to view]
RE: MSXML and COM Interop v-phuang NO[at]SPAM online.microsoft.com (
12/2/2005 12:00:00 AM
Hi

Based on my research, we did not recommend use MSXML in .NET application,
because there is a great XML class in .NET.
As for the problem if we can indirectly use MSXML in .NET. That is commonly
the scenario that the existing legacy COM project which underlying used
MSXML and now we wants to use it in .NET.

In such scenario, we recommend put the COM in COM+ and use it from .NET.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: MSXML and COM Interop DavidCoghlan
12/2/2005 1:56:02 AM
Hi Peter,

Thanks for your response. The situation is as you describe: we have a native
C++ COM component that makes extensive use of MSXML, and need to use this
from the .NET environment. We can modify the library so that we don't need to
instantiate MSXML objects in .NET or marshall MSXML pointers across the
interop boundary, but re-writing the library to use the .NET XML API is not
possible!

If I understand correctly, you're saying that we should run this component
in a separate process rather than as an in-process server? This is obviously
not ideal from a performance perspective.

I understand that the issue is to do with the MSXML garbage collector. Are
there any workarounds that would allow us to use our component in-process
within .NET? For example, how about if our component is only accessed from
unmanaged (un-garbage collected) MC++ types, via an MC++ wrapper?

Thanks for your help.

Regards,

David Coghlan

[quoted text, click to view]
RE: MSXML and COM Interop v-phuang NO[at]SPAM online.microsoft.com (
12/3/2005 12:00:00 AM
Hi

So far there are a lot of problems when using MSXML inproc in .NET
application.
I understand your scenario that the out proc approach may affect the
problem, but inproc usage may lead to unexpected behavior, that is why we
publish the KB to suggest the customer use the System.XML class. For legacy
COM component, so far our workaround is to use it in an COM+ which commonly
did not need to do many migration efforts.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button