There is interop, it's just backwards.. i.e. you can call a .net 1.1 component from 2.0 but not the other way around. I can't see why COM interop wouldn't work though. Did you sign the assembly, enabled COM interop then install the asm into the GAC You should then find it in the references list for VS. Not the best option performance wise I suppose
This is not possible. Microsoft has stated that there is no forward compatibility with .NET Framework v2.0. Assemblies built in v2.0 will simply not work with v1.1.
Martin, The message VS2003 raises is: "A reference to 'NET20ClassLibrary' could not be added. Converting the type library to a .NET assembly failed. Type library NET20ClassLibrary was exported from a CLR assembly and can not be re-imported as a CLR assembly."
So I tried to make another COM wrapper using VB6 (indeed interop performance is not a problem in this particular case), say VB6ClassLibrary. If I call it from VB6 it works, and I can add it as reference from VS2003 even. However running the .NET 1.1 test app, I get this exception:
"System.BadImageFormatException: The format of the file 'NET20ClassLibrary' is invalid."
I suppose that, calling it from VB6, the wrapper is using the correct CLR version (2.0) to load the assembly, but from the .NET 1.1 test app, the wrapper use the latter, wrong CLR version (1.1) to load NET20ClassLibrary...
Vikram, My initial aim was to achieve in-process forward compatible interop, but at this point I'm giving up so I will explore out-process alternatives as you suggest. However, I think a webservice is cumbersome from an administrative point of view. By 'sockets' do you mean .NET remoting or a more low-level approach Please, could you give me a hint of how to implement something like that (considering the different framework versions, of course)
But is there no workaround either I don't look necessarily for a transparent solution...
Anyway, this is so sad. I think that, in the same way there is interop between COM and .NET (forward compatibility, in a sense), should exist at least limited interop between different versions of the same framework.
How can I call .NET 2.0 components from .NET 1.1?
lshpiz
http://dotnetjunkies.com/WebLog/saarc/comments/135635.aspx
Parker Whittle
CasuaLXX
Regards,
Ricardo Stuven.
fleacricket
I can't see why COM interop wouldn't work though. Did you sign the assembly, enabled COM interop then install the asm into the GAC You should then find it in the references list for VS. Not the best option performance wise I suppose
solmyr72
This is not possible. Microsoft has stated that there is no forward compatibility with .NET Framework v2.0. Assemblies built in v2.0 will simply not work with v1.1.
Regards,
Vikram
sace22
The message VS2003 raises is:
"A reference to 'NET20ClassLibrary' could not be added. Converting the type library to a .NET assembly failed. Type library NET20ClassLibrary was exported from a CLR assembly and can not be re-imported as a CLR assembly."
So I tried to make another COM wrapper using VB6 (indeed interop performance is not a problem in this particular case), say VB6ClassLibrary.
If I call it from VB6 it works, and I can add it as reference from VS2003 even.
However running the .NET 1.1 test app, I get this exception:
"System.BadImageFormatException: The format of the file 'NET20ClassLibrary' is invalid."
I suppose that, calling it from VB6, the wrapper is using the correct CLR version (2.0) to load the assembly, but from the .NET 1.1 test app, the wrapper use the latter, wrong CLR version (1.1) to load NET20ClassLibrary...
Vikram,
My initial aim was to achieve in-process forward compatible interop, but at this point I'm giving up so I will explore out-process alternatives as you suggest.
However, I think a webservice is cumbersome from an administrative point of view.
By 'sockets' do you mean .NET remoting or a more low-level approach Please, could you give me a hint of how to implement something like that (considering the different framework versions, of course)
Thanks,
Ricardo Stuven.
SASMJS
You have to go for sockets at a low-level.
http://www.developerfusion.com/show/3918/
Regards,
Vikram
Christophe Bauwens
I guess you have to go for something like wrapping the functionality as webservices or communicate over sockets.
Regards,
Vikram
Philip Galea
Anyway, this is so sad. I think that, in the same way there is interop between COM and .NET (forward compatibility, in a sense), should exist at least limited interop between different versions of the same framework.
Regards,
Ricardo Stuven.
PaulRay