hi all,
I have an unmanaged app that uses some dotnet based components we have
written via COM (the components are registered for COM interop). The
components are all written/use v 1.1 of the dotnet runtime.
With the dotnet 2.0 runtime installed, we are finding the app blows up
trying to create the components and we can see in the debugger that the
wrong version of the runtime is being loaded when we try to create the
components.
Is it possible to some how configure the app to only use v 1.1 of the
runtime?
TIA
bg
Nicole Calinoiu - 01 Nov 2005 16:57 GMT
This is done via the application's configuration file. See
http://msdn2.microsoft.com/en-us/library/w4atty68 for implementation details
and http://msdn2.microsoft.com/en-us/library/9w519wzk if you would like a
bit more background info.
> hi all,
>
[quoted text clipped - 13 lines]
>
> bg
Willy Denoyette [MVP] - 01 Nov 2005 23:58 GMT
> hi all,
>
[quoted text clipped - 13 lines]
>
> bg
Unfortunately, you can't, when an unmanaged application calls into a managed
assembly, the latest CLR version available will be loaded in the calling
unmanaged process, even if the assembly was built with an older version of
the framework. The reason for this is that it should be possible to load/run
v1.x and v2.0 assemblies into the same process side by side, and as you need
the v2.0 CLR to run the v2.0 assemblies, the v2.0 version will be loaded.
Willy.
Metallikanz! - 05 Nov 2005 13:03 GMT
A managed app will always load the CLR against which it was build and
tested, things are different for an unmanaged app, which will roll over and
always load the latest version of the CLR.
This can however be controlled by creating a CLR host which can then be
configured to load the required version of the CLR using the
CorBindToRuntimeEx() hosting API call.
Google on CLR hosting for more information and also have a look at an
article about this (probably at GotDotNet) by Steven Pratschner.
HTH, Metallikanz!
> hi all,
>
[quoted text clipped - 13 lines]
>
> bg