Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to load two versions of the .NET runtime in the same process?

There are two scenarios I need to clarify:

  1. An executable compiled with .NET 3.5 needs to use a library compiled with .NET 1.1 and the library must run on the 1.1 runtime.

  2. An executable compiled with .NET 1.1 needs to use a library compiled with .NET 3.5.

I cannot find a reliable source stating that it is not possible to load two versions of the .NET runtime and Microsoft's documentation is very vague on this matter.

like image 333
CodeForNothing Avatar asked Oct 14 '08 15:10

CodeForNothing


1 Answers

No -- you can't load the CLR into the same process twice. See the documentation for CLR Hosting

As with earlier versions of the runtime, the CorBindToRuntimeEx function initializes the runtime. You can choose which version of the runtime to load, but a process can host only one version.

like image 172
Rob Walker Avatar answered Sep 23 '22 17:09

Rob Walker