开发者

How come .net 4.0 and .net 2.0 CLR's can exist in a same machine

开发者 https://www.devze.com 2022-12-26 20:45 出处:网络
I have a basic doubt that, How can we have both CLR\'s 开发者_开发知识库on a same machine. If this is possible, When I refer few dll\'s of 4.0 and setting application pool to 2.0 why Cant I run the we

I have a basic doubt that, How can we have both CLR's 开发者_开发知识库on a same machine. If this is possible, When I refer few dll's of 4.0 and setting application pool to 2.0 why Cant I run the website(I am getting errors).When we refer the dll's from web.config it means it searches for GAC when that particular 4.0 dll is available in GAC Why dont it load (How come it is not loading).. Please clarify my doubts


Yes, both CLRs can be on the same machine - in fact, .NET 4 allows you to have the same process hosting both CLRs at the same time!

Different assemblies in the GAC will have different versions, so if your references specify the version, the CLR will load the appropriate one. Of course, you need to make sure you've got the appropriate CLR loading the appropriate assembly; while the v4 CLR can load v2 assemblies (with some restrictions, IIRC), you shouldn't try to load a v4 assembly from the v2 CLR.

As for why you're having problems - that's really impossible to say without more information. (Any time you ask a question and you have an error, say what that error is.)


Application pools are set to run a specific version of the framework. It uses this information to determine which assembly to load from GAC.

You can't load a .NET 4 assembly from a 2.0 application/process.

You can have 1.0, 1.1, 2, 3, 3.5 and 4 all installed side-by-side.


Yes that has been made possible by making 4.0 core dll as CLR.dll And 2.0 as mscorwks.dll

So if you capture a process dump with both loaded , You would see lmvm mscorwks from 2.0 and lmvm clr from 4.0

But you still cannot combine 1.1 and 4.0 in same process

http://geekswithblogs.net/sdorman/archive/2008/11/10/clr-4.0-in-process-side-by-side-clr-hosting.aspx

Thanks JAs

0

精彩评论

暂无评论...
验证码 换一张
取 消