How does IJW determine version of CLR to load?

  • Thread starter Thread starter Leon Gorbaty [Bentley]
  • Start date Start date
L

Leon Gorbaty [Bentley]

Hi,

We have some managed assemblies that are compiled with the /clr switch for
some native code to load. These are currently compiled and linked against a
pure .NET 1.0 environment.

I have both VS.NET 1.0 and 1.1 installed on my box. I noticed (in debugger)
that 1.1 system dll's are being loaded (specifically the 1.1. CLR). I would
have expected the IJW mechanism to inspect the managed assemblies it has to
load, and run the appropriate CLR.

How does this work and what options do we have in controlling the CLR
loading. For example, knowing what I have now observed, I cannot trust
"machine.config" files on user-deployed computer, because I don't know which
CLR version is being read.

Regards,

Leon
 
Leon Gorbaty said:
I have both VS.NET 1.0 and 1.1 installed on my box. I noticed (in debugger)
that 1.1 system dll's are being loaded (specifically the 1.1. CLR). I would
have expected the IJW mechanism to inspect the managed assemblies it has to
load, and run the appropriate CLR.

How does this work

I suspect someone will explain it to you shortly ... said:
and what options do we have in controlling the CLR
loading. For example, knowing what I have now observed, I cannot trust
"machine.config" files on user-deployed computer, because I don't know which
CLR version is being read.

If you decide that you want complete control of the load of common language
runtime you may want to check the docs for this function
CorBindToRuntimeEx() which allows you to load the version and type (server
or not) that you like. I _think_ that this is frowned on, but when you
gotta, you gotta. :-)

Regards,
Will
 
The version of the CLR used to run your appliaction is determined by the
version of mscoree.dll, this version corresponds to the version of the
newest .NET version, so if you have .NET 1.0 and 1.1 installed, mscoree.dll
is of version 1.1.
Applications built using the .NET Framework version 1.0 will automatically
use version 1.1 when installed , else it will use v1.0.
You can change this default behavior by using an application config file ,
but I don't see any reason to do this as the application will run properly
on version 1.1.

http://msdn.microsoft.com/library/d...de/html/cpcontargetingnetframeworkversion.asp

has more information.

Willy.
 
Back
Top