简体   繁体   English

在2.0 CLR中运行.NET 3.5代码

[英]Running .NET 3.5 Code In 2.0 CLR

I am confused about this - I have .NET 3.5 on my machine and VS2008 - The servers all run .NET2.0 我对此感到困惑 - 我的机器上有.NET 3.5和VS2008 - 服务器都运行.NET2.0

Can I compile code on my machine and target .NET3.5 and still run on the 2.0 CLR?? 我可以在我的机器上编译代码并以.NET3.5为目标并仍然在2.0 CLR上运行吗?

Is there a mtrix anywhere which highlights .net versions and CLR versions and their compatability? 是否有mtrix任何地方突出.net版本和CLR版本及其兼容性?

How do I find out what CLR i am using?? 我如何找出我正在使用的CLR?

This is a bit of a complex topic but here are the high points. 这是一个复杂的主题,但这里有高点。 The two main parts of the 3.5 framework are a set of libraries, most notably System.Core.dll, and a service pack to the CLR (2.0SP1). 3.5框架的两个主要部分是一组库,最着名的是System.Core.dll,以及一个CLR(2.0SP1)的服务包。

You cannot safely compile applications against the 3.5 libraries and deploy them to a machine only running 2.0RTM. 您无法安全地针对3.5库编译应用程序并将它们部署到仅运行2.0RTM的计算机上。 This will work in some circumstances, but it does so by sheer luck. 这在某些情况下会起作用,但纯粹是运气。 Several features in the 3.5 framework rely on bug fixes included in 2.0SP1. 3.5框架中的一些功能依赖于2.0SP1中包含的错误修复。

What you can safely do is use VS2008 to target the 2.0 runtime. 你可以安全地做的是使用VS2008来定位2.0运行时。 This will give you most of the new language features while allowing you to safely deploy to 2.0RTM machines. 这将为您提供大部分新语言功能,同时允许您安全地部署到2.0RTM计算机。

.Net 3.5 is actually just extended libraries added to the 2.0 framework. .Net 3.5实际上只是添加到2.0框架的扩展库。 Hence, you still run 2.0. 因此,你仍然运行2.0。

3.5 is not a replacement, its an addition! 3.5不是替代品,它是一个补充!

.Net 3.5在CLR 2上运行,但确实要求您在服务器上安装最新的3.5的SP - 这与现有的.net 2.0应用程序非常兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM