捕获.NET 2.0和.NET 2.0SP1中的RedBits差异

When you install .NET 3.5 on your system, while the .NET CLR is the same and runs the same, there's some additional Properties and Methods that were added to the Base Class Libraries in order to make some 3.5 features like LINQ work as well as fix a few customer issues.

当您在系统上安装.NET 3.5时,.NET CLR相同且运行相同,但为了使LINQ等3.5功能正常工作,还向基类库中添加了一些其他属性和方法。解决一些客户问题。

Daniel Moth has a very nice diagram explaining what "RedBits" and "GreenBits" mean.

Daniel Moth有一个非常漂亮的图表,解释了“ RedBits”和“ GreenBits”的含义。

"When we say red bits, those are Framework bits that exist in RTM today i.e. NetFx v2.0 and NetFx v3.0...When we say green bits, we mean brand new assemblies with brand new types in them. These are simply adding to the .NET Framework (not changing or removing) just like Fx 3.0 was simply adding to v2.0 without changing existing assemblies and without changing the CLR engine."

“当我们说红色的位时,那些是当今RTM中存在的Framework位,即NetFx v2.0和NetFx v3.0 ...当我们说绿色的位时,我们的意思是其中带有全新类型的全新装配。这些只是就像Fx 3.0一样,将其添加到.NET Framework中(而不更改或删除)只是将其添加到v2.0中,而无需更改现有程序集和CLR引擎。”

Krzysztof has a blog post about these new (kinda obscure) APIs and fortunately a nice FxCop Rule you can drop into your C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules folder and you'll get a nice warning if you bump into one of these APIs. To be clear, they are not something you'll bump into in your regular life, but it's possible. Dan Moseley blogged about this from the MSBUILD point of view.

Krzysztof的博客文章涉及这些新的(有点晦涩)的API,幸运的是,您可以将一个不错的FxCop规则放到C:\ Program Files \ Microsoft Visual Studio 9.0 \ Team Tools \ Static Analysis Tools \ FxCop \ Rules文件夹中,如果碰到这些API之一,就会得到一个很好的警告。 需要明确的是,它们不是您平常生活中会碰到的东西,但有可能。 Dan Moseley从MSBUILD的角度就此发表了博客

The situation you might get into would be that you'd develop on a Visual Studoi 2008 system with .NET 3.5 and targeted .NE T Framework 2.0 (but you have 2.0 SP1 with these new 2.0 methods), then you deploy to an older system that has only .NET 2.0 RTM (not Service Pack'ed). At this point you might get a MethodMissingException because that older system might not have the new method or property. Of course, you could just install the latest 2.0, but if you don't want to, then don't use the new methods/types/properties. Hence the optional FxCop Rule.

您可能会遇到的情况是,您将在具有.NET 3.5和目标.NE T Framework 2.0的Visual Studoi 2008系统上进行开发(但是您具有使用这些新2.0方法的2.0 SP1),然后将其部署到较旧的系统上仅有.NET 2.0 RTM(未提供Service Pack)。 此时,您可能会收到MethodMissingException,因为该旧系统可能没有新的方法或属性。 当然,您可以只安装最新的2.0,但是如果您不想安装,则不要使用新的方法/类型/属性。 因此,可选的FxCop Rule

Krzysztof send me a text file with the list of new Properties and Methods and I wrote a little program to generate an HTML file that shows the additions (many are new overloads) and links them to MSDN help. I couldn't get to the exact method overloads so do make sure the parameters line up when you're reading the help.

Krzysztof给我发送了一个文本文件,其中包含新的“属性和方法”列表,我编写了一个小程序来生成一个HTML文件,该文件显示添加的内容(许多是新的重载)并将它们链接到MSDN帮助。 我无法获得确切的方法重载,因此在阅读帮助时请确保参数对齐。

http://www.hanselman.com/blog/content/binary/RedBitsChangesv2.html

http://www.hanselman.com/blog/content/binary/RedBitsChangesv2.html

NOTE: This is a different list from the original diff I did between 3.5 and 2.0. The original list was the differences between all of 2.0 and 3.5 and this list is JUST the BCL. Just the core.

注意:这与在3.5和2.0之间进行的原始比较不同。 原始列表是2.0和3.5之间的差异,此列表仅是BCL。 只是核心。

翻译自: https://www.hanselman.com/blog/catching-redbits-differences-in-net-20-and-net-20sp1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值