all groups > dotnet interop > april 2006 >
You're in the

dotnet interop

group:

.NET 1.1 / 2.0 Side-By-Side Interop


.NET 1.1 / 2.0 Side-By-Side Interop Thomas S. Trias
4/28/2006 10:12:01 AM
dotnet interop:
I have a web service proxy developed in .NET 1.1. It is used by traditional
ASP, and I have some test projects that use it in other COM environments.

We are migrating to VS 2005 / .NET 2.0, so I installed VS 2005 (which
installed .NET 2.0).

I can still access almost every property or method on the proxy and its
related results. However, since .NET 2.0 updated mscoree.dll, any attempt to
use "For Each" on my collection classes fails. I can call the hidden
_NewEnum methods directly and get an IEnumVariant interface pointer, but this
doesn't hep much in ASP.

I also noticed, on a most likely related note, that if I use the 2.0 version
of RegAsm, it no longer respects my proper use of negative DISPIDs when
generating the type library. VB and VBScript use IDispatch and the DISPID of
-4 (0xFFFFFFFC) in order to perform the magic behind "For Each". Could this
be why I am experiencing this problem? Regardless of how the proxy is
compiled or registered, "For Each" still fails.

Will registering the older version of mscoree.dll as the inprocserver32
help? Is there a way to extract it from the .NET 1.1 distributable, or do I
have to do a complete fresh install of the 1.1 framework? I will try it and
see, but any insight would be great.

This does not bode well for side-by-side execution and COM Interop...

RE: .NET 1.1 / 2.0 Side-By-Side Interop Thomas S. Trias
5/3/2006 1:53:08 PM
Well, I managed to work around the issue compiling in 1.1 even with
2.0installed as long as I rename the _NewEnum method / property
GetEnumerator. I'll try some more tests to see what the exact requirements
are (what if I want COM enumeration to be subtly different from .NET
enumeration, so I have two different methods?). What about the neagtive
DISPIDs? Are we still allowed to set them in or Interop interface
definitions, or will they be setup automagically in 2.0?

-Tom

[quoted text, click to view]
AddThis Social Bookmark Button