Application referencing dll build with different version framwork

A

al_qwertyuiop

Hi,

I was wondering what happens if an .net exe compiled with 1.1 uses one
dll compiled with 2.0 and one dll compiled with 1.1.
Supposing that the target machine has both 1.1 and 2.0. Does the 2.0
dll correctly use the .net 2.0 system's dll? and the 1.1 correclty use
1.1 dlls?

I'm know how exe choose .net version. But I cant figureout what happens
when the exe uses dll compiled with different versions.
Can some clearme it out?

thanks,
Al
 
G

Guest

I was wondering what happens if an .net exe compiled with 1.1 uses one
dll compiled with 2.0 and one dll compiled with 1.1.
Supposing that the target machine has both 1.1 and 2.0. Does the 2.0
dll correctly use the .net 2.0 system's dll? and the 1.1 correclty use
1.1 dlls?

It depends on which version of the CLR was loaded by the Exe. There can only
be one runtime version loaded into the process and the corresponding version
of the system libraries will be used.

If the Exe is loaded with the v2.0 runtime, the Dll compiled with v1.1
should load and hopefully run correctly, but will use the v2.0 libraries.

If the Exe is loaded with the v1.1 runtime, you'll get an excepion trying to
load any v2.0 assembly.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top