R – Multiple versions of .NET CLR running concurrently

\clrassembliesnet

Let's say I have a .NET user application (.exe) running under Windows that was compiled in .NET Framework Version 3.0 (VS2008). If that application loads another .NET Assembly (.dll) that was compiled on a different computer using .NET Framework Version 2.0 (VS2005), will the loaded assembly use the existing 3.0 runtime (which will run in backwards compatibility mode)? Or will the .NET Framework 2.0 runtime load into the system's process space, and we now have two .NET runtimes running concurrently?

Assertion: This is not using VS2008 multi-targeting.

Best Answer

If it is in the same process space, as you have outlined, it will run under 3.0. If you want two different CLRs to spin up, you will have to create a service boundary (web service or WCF works fine here - not WCF for 2.0 obviously) and call the service from the other app.