Todd
Todd

Reputation: 426

Multiple versions of .NET CLR running concurrently

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.

Upvotes: 3

Views: 1707

Answers (3)

On Freund
On Freund

Reputation: 4436

.NET runtime versions are usually backwards compatible, so the 3.0 runtime will host the 2.0 assembly (not to mention that 3.0 is basically the same runtime as 2.0). In any case, two versions of the CLR cannot be loaded to the same process.

Upvotes: 1

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

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.

Upvotes: 2

John Saunders
John Saunders

Reputation: 161831

There is no .NET 3.0 CLR. .NET 3.0 and 3.5 both use the .NET 2.0 CLR.

Of course, if your .NET 3.0 application uses .NET 3.0 features, then .NET 3.0 will need to be installed.

Upvotes: 7

Related Questions