.NET 4.0中有一个新的GAC,为什么呢? [英] .NET 4.0 has a new GAC, why?

查看:152
本文介绍了.NET 4.0中有一个新的GAC,为什么呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

%WINDIR%\ Microsoft.NET \装配\ 是新 GAC 。这是否意味着现在我们要管理两个GACS,一个用于.NET 2.0〜3.5的应用程序,另一个用于.NET 4.0的应用程序?

%windir%\Microsoft.NET\assembly\ is the new GAC. Does it mean now we have to manage two GACs, one for .NET 2.0-3.5 applications and the other for .NET 4.0 applications?

现在的问题是,为什么?

The question is, why?

推荐答案

是的,因为有2个不同的全局程序集缓存(GAC),则必须单独管理它们。

Yes since there are 2 distinct Global Assembly Cache (GAC), you will have to manage each of them individually.

在.NET Framework 4.0中,海关总署通过一些变化去了。海关总署分成两种,一种为每个CLR。

In .NET Framework 4.0, the GAC went through a few changes. The GAC was split into two, one for each CLR.

同时用于.NET Framework 2.0和.NET Framework 3.5中的CLR版本是CLR 2.0。没有必要在previous两项框架的版本分裂GAC。在.Net框架4.0打破旧的应用程序的问题。

The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0. There was no need in the previous two framework releases to split GAC. The problem of breaking older applications in Net Framework 4.0.

要避免的CLR 2.0和CLR 4.0的问题,海关总署现在被分成私人GAC的每个runtime.The主要的变化是,CLR 2.0版的应用程序现在还无法看到在GAC CLR 4.0版组件。

To avoid issues between CLR 2.0 and CLR 4.0 , the GAC is now split into private GAC’s for each runtime.The main change is that CLR v2.0 applications now cannot see CLR v4.0 assemblies in the GAC.

来源

为什么?

这似乎是因为有一个CLR变化在.NET 4.0中,但不是在2.0至3.5。同样的事情发生在1.1至2.0 CLR。似乎在GAC具有存储不同版本的组件的,只要它们是从同一的CLR的能力。他们不希望打破旧的应用程序。

It seems to be because there was a CLR change in .NET 4.0 but not in 2.0 to 3.5. The same thing happened with 1.1 to 2.0 CLR. It seems that the GAC has the ability to store different versions of assemblies as long as they are from the same CLR. They do not want to break old applications.

请参阅有关GAC变化4.0 在 MSDN以下信息。

See the following information in MSDN about the GAC changes in 4.0.

例如,如果两个.NET 1.1和.NET 2.0共享相同的GAC,那么.NET 1.1的应用程序,加载程序集,从这个共享的GAC,可以让.NET 2.0组件,从而打破了.NET 1.1应用程序

For example, if both .NET 1.1 and .NET 2.0 shared the same GAC, then a .NET 1.1 application, loading an assembly from this shared GAC, could get .NET 2.0 assemblies, thereby breaking the .NET 1.1 application

同时用于.NET的CLR版本   Framework 2.0和.NET Framework 3.5的   是CLR 2.0。作为其结果,有   没必要在previous 2   框架的版本分裂GAC。   打破旧的问题(在此   情况下,.NET 2.0)的应用   在复出的.Net框架4.0   这点CLR 4.0发布。因此,   为了避免相互干扰问题   CLR 2.0和CLR 4.0,海关总署现   分为私人GACS每个   运行时。

The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0. As a result of this, there was no need in the previous two framework releases to split the GAC. The problem of breaking older (in this case, .NET 2.0) applications resurfaces in Net Framework 4.0 at which point CLR 4.0 released. Hence, to avoid interference issues between CLR 2.0 and CLR 4.0, the GAC is now split into private GACs for each runtime.

由于CLR在未来的版本更新,你可以期望同样的事情。如果仅仅是语言的变化,那么你可以使用相同的GAC。

As the CLR is updated in future versions you can expect the same thing. If only the language changes then you can use the same GAC.

这篇关于.NET 4.0中有一个新的GAC,为什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆