我应该附带什么 .NET Framework 版本; 2、3、3.5?

发布于 2024-07-04 07:26:27 字数 1448 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

潇烟暮雨 2024-07-11 07:26:28

我想问的一个问题是您想使用 .NET 3.5 的哪些功能? 许多大肆宣传的功能实际上是 C# 3.0 功能,而不是 .NET 3.0/3.5 特有的功能,并且由于 C# 3.0 使用与 .NET Framework 2.0 相同的 CLR,您也可以在 2.0 应用程序中自由使用它们。 这仅需要 VS 2008。

示例包括:

  • Lambda 表达式
  • 对象初始值设定项
  • 匿名类型
  • 局部变量类型推断
  • 扩展方法

我在自己的 .NET 2.0 项目中使用了其中的许多方法,没有出现任何问题。

如果您需要特定于框架的功能(例如 Linq、WPF 等),那么您必须升级。

One question I'd like to ask is what are the features of .NET 3.5 that you'd like to use? Many of the hyped features are actually C# 3.0 features, not features specific for .NET 3.0/3.5 and since C# 3.0 uses the same CLR as .NET Framework 2.0 you are free to use them in your 2.0 applications too. This only requires VS 2008.

Examples are:

  • Lambda expressions
  • Object initializers
  • Anonymous types
  • Local variable type inference
  • Extension methods

I use many of these in my own .NET 2.0 projects without problems.

If there are framework specific features you want (like Linq, WPF, etc), then you'd have to upgrade.

她如夕阳 2024-07-11 07:26:28

.net 3.5sp1 bootstrapper 太慢了,特别是如果您使用 asp.net 应用程序(与 Windows 窗体相比),在只有 .net 2.0 的计算机中,它会加载整个框架,这意味着您正在查看大约 20-30在中等互联网连接和机器速度下,下载+安装时间为几分钟。

.net 3.5sp1 bootstrapper is too slow especially if you are using asp.net application (compared to windows forms), in a machine which only has .net 2.0, it loads the whole framework and that means you are lookong at about 20-30 mins of download + install time on a moderate internet connection and machine speed.

皓月长歌 2024-07-11 07:26:28

我总是使用最新版本的框架。 这对用户来说可能是一个很小的前期负担,但应用程序的升级间隔时间要长得多。 这对您来说可能重要,也可能不重要,但请考虑:

如果您在 2005 年使用 .NET 1.1 发布了应用程序,那么您的应用程序运行的框架现在已不再受到主流支持,并且可能存在未修补的安全漏洞或其他严重问题Microsoft 可能不会处理这些问题,并且您无法在自己的代码中对此进行补偿。 2008 年您唯一的选择就是让您的用户立即升级他们的框架版本。 而且,众所周知,让用户及时更新内容可能会出现问题。

同样,考虑一下您在 2011 年的情况。如果您现在针对 .NET 3.5 进行编程,那么您的应用程序在交付时的使用寿命将更长。 如果您现在发布 .NET 2.0,几年后您将不得不说服您的用户升级他们的框架(记住,这些代码对他们没有明显的好处),这样您就可以正确支持此应用程序。

另外,如果您计划实现 3.5 级功能(例如,明年的 LINQ to SQL),那么现在发布 3.5(而不是 2.0)更符合您的利益,因为这将使以后的部署不再是您的问题。

I always use the most up-to-date version of the Framework. This may be a small up-front burden on users, but the app has a much longer life between upgrades. That may or may not be important to you, but consider:

If you had shipped an application in 2005 using .NET 1.1, the framework your app runs on is now out of mainstream support, and may have unpatched security vulnerabilities, or other serious problems which Microsoft may not deal with, and which you cannot compensate for in your own code. Your only alternative in 2008 is to get your users to upgrade their framework version now. And, as we all know, getting users to update things in a timely fashion can be problematic.

Likewise, consider your situation in 2011. If you program for .NET 3.5 now, your app, as-shipped, will be viable longer. If you ship for .NET 2.0 now, you'll be in the position, in a few years' time, of having to convince your users to upgrade their framework (code which has no perceived benefit to them, remember) so that you can properly support this application.

Also, if you plan to implement 3.5-class features (LINQ to SQL next year, for example), it's in your interest to ship for 3.5 now, rather than 2.0, as it will make deployment later less of a problem for you.

温柔一刀 2024-07-11 07:26:28

请记住,对用户来说“一个小负担”可能意味着您的应用程序被接受和拒绝之间的差异。

我为一家公司运营 IT。 我们公司标准不是3.5。 您必须有一个非常流畅的应用程序才能让我将每个人都升级到 .NET 3.5,这样您的应用程序才能运行。 换句话说,可能不会发生。 我会找到另一个不会给我们已经超负荷的 IS 部门增加额外“小负担”的应用程序。

其他人评论了您真正要使用的功能。 如果 1.1 或 2.0 具有真正的功能集,您需要坚持使用它。

Remember that "a small burden" to users could mean the difference between acceptance and rejection of your application.

I run IT for a company. Our company standard is not 3.5. You would have to have one really slick application to get me to upgrade everyone to .NET 3.5 just so your app can run. In other words, probably not happening. I'll find another app that doesn't add an additional "small burden" onto our already overloaded IS department.

Somebody else commented about what features are you really going to use. If 1.1 or 2.0 has the real feature set you need stick with it.

心病无药医 2024-07-11 07:26:28

您应该使用您进行最多测试的 .Net 版本来分发您的应用程序。 如果您一直在 .Net 2.0 中进行所有开发和测试,那么就使用 2.0 进行发布。

但是,您可能应该对您的客户进行针对 3.5 的测试并随其一起发布,因为自 2.0 发布以来框架中已经修复了任何错误。 该框架已经如此庞大,以至于分发早期版本可能没有任何好处,即使它出现在 WCF、WPF 等之前,除非您支付带宽成本来分发它,或者目标设备的存储空间有限空间。

You should distribute your app with whatever version of .Net is the version you've done the most testing against. If you've been doing all your developing and testing in .Net 2.0, then ship with 2.0.

But you may owe it to your customers to test against 3.5 and ship with that, instead, for the sake of any bugs that have been fixed in the framework since 2.0 was released. The framework is already so large that there probably isn't any benefit to distributing an earlier version, even if it came before WCF, WPF, etc., unless you're paying bandwidth costs to distribute it, or the target device has limited storage space.

冰雪梦之恋 2024-07-11 07:26:28

不要忘记 .Net 4.0 将与该框架的早期版本略有不同。 .Net 4.0 将与 .Net 3.5 并排安装 (SxS) 并向后安装。 如果您升级应用程序以使用 .Net 4.0,那么您的长期用户(也称为以前的版本)最终将不得不安装该框架的全新版本。

如果您考虑您的应用程序和框架将在客户端计算机上使用多少磁盘空间,那么请不要忘记这种“隐藏”的额外空间使用。 如果您现在将应用程序从 2.0 升级到 3.5,那么您的应用程序可能能够以完整的功能存在更长时间,而无需强迫用户安装第二个框架,该框架会占用另外 20+ MB 的空间。

Don't forget that .Net 4.0 will be a little different from previous versions of the framework. .Net 4.0 will be installed side by side (SxS) .Net 3.5 and back. If you upgrade your app to use .Net 4.0 then your long term users (aka previous versions) will end up having to install a whole new version of the framework.

If your considering how much disk space you are going to use up on the client machines with your app and the framework, then don't forget this "hidden" use of extra space. If you upgrade your app now from 2.0 to 3.5 then your app might be able to exist longer with complete functionality without forcing the user to install a 2nd framework that uses up another 20+ MB of space.

飘落散花 2024-07-11 07:26:28

我同意您应该满足您的应用程序的需求,但您还应该为您的应用程序将来的需求做好准备。

如果您有一些空闲周期,您可以在 SCM 中迁移应用程序的一个单独分支,该分支与 3.5 运行时一起运行,并且当您实际需要升级时,您有一个工作分支(假设您使其保持最新状态)日期与一些双周合并)。

I agree that you should with what your App needs, but you should also prepare for what your apps will need in the future.

If you have a few spare cycles, you could migrate a separate branch of your apps in your SCM which is running with the 3.5 Runtime and when you actually need to upgrade, you have a working branch (Assuming that you keep it up-to-date with some bi-weekly merge).

远昼 2024-07-11 07:26:28

我发现 2.0 版是最容易定位和部署的版本,因为很多人已经安装了它。如果您的客户群中有相当大一部分使用 Vista,您可能会考虑升级到 3.0。
高于该版本的版本几乎总是需要安装,这对某些用户来说可能会很痛苦。

编辑:“框架版本不再支持”的说法站不住脚,因为 3.0 是 2.0 的扩展,而 3.5 是 2.0 的扩展。 根据定义,只要 3.5 存在,2.0 就会受到支持。 版本 1.1 是唯一一个完全独立的运行时且不再受支持的版本。

I've found version 2.0 to be the easiest version to target and deploy since a lot of people have it installed already, If a sizable portion of your client base use Vista you might consider upgrading to 3.0.
Versions above that nearly always require an install which can be a pain for some users.

Edit: The "framework version going out of support" argument holds no water since 3.0 is an extension of 2.0 and 3.5 is an extension of that. By definition 2.0 will be supported as long as 3.5 is. Version 1.1 is the only version that is a completely separate runtime and is no longer supported.

黯然 2024-07-11 07:26:28

如果您计划升级到 3.5 SP1,则应考虑使用 新的 .NET Framework 客户端配置文件安装包

.NET 3.5 SP1 为构建 .NET 客户端应用程序的开发人员引入了一个新的安装包选项,称为“.NET Framework Client Profile”。 这提供了一个新的安装程序,可以在尚未安装 .NET Framework 的计算机上为 .NET 客户端应用程序提供更小、更快且更简单的安装体验。

.NET Framework 客户端配置文件设置仅包含 .NET Framework 中通常用于客户端应用程序方案的那些程序集和文件。 例如:它包括 Windows 窗体、WPF 和 WCF。 它不包括 ASP.NET 以及主要用于服务器场景的库和组件。 我们预计此安装包的大小约为 26MB,并且其下载和安装速度比完整的 .NET Framework 安装包快得多。

.NET Framework 客户端安装包中的程序集和 API 与完整 .NET Framework 安装包中的程序集和 API 100% 相同(它们实际上是相同的二进制文件)。 这意味着应用程序可以针对 .NET 3.5 SP1 的客户端配置文件和完整配置文件(无需重新编译)。 所有使用 .NET Client Profile 设置工作的 .NET 应用程序都会自动使用完整的 .NET Framework。

If you are planning to upgrade to 3.5 SP1, you should consider using the New .NET Framework Client Profile Setup Package.

.NET 3.5 SP1 introduces a new setup package option for developers building .NET client applications called the ".NET Framework Client Profile". This provides a new setup installer that enables a smaller, faster, and simpler installation experience for .NET client applications on machines that do not already have the .NET Framework installed.

The .NET Framework Client Profile setup contains just those assemblies and files in the .NET Framework that are typically used for client application scenarios. For example: it includes Windows Forms, WPF, and WCF. It does not include ASP.NET and those libraries and components used primarily for server scenarios. We expect this setup package to be about 26MB in size, and it can be downloaded and installed much quicker than the full .NET Framework setup package.

The assemblies and APIs in the .NET Framework Client setup package are 100% identical to those in the full .NET Framework setup package (they are literally the same binaries). This means that applications can target both the client profile and full profile of .NET 3.5 SP1 (no recompilation required). All .NET applications that work using the .NET Client Profile setup automatically work with the full .NET Framework.

独享拥抱 2024-07-11 07:26:28

3.5 框架已经有了第一个 Service Pack 版本,因此它比发布后更稳定,但请记住,如果出于某种原因遇到问题,将代码从 2.0 升级到 3.5 比返回到 3.5 容易得多。显示塞子。

wiki 文章很好地展示了新功能。

3.5 framework has had it's first Service Pack release, so it's more stable than it was after release, but bear in mind it is far easier to upgrade code from 2.0 to 3.5 than it is to go back to 3.5 if for whatever reason you encounter a show stopper.

The wiki article shows the new features very well.

浮生面具三千个 2024-07-11 07:26:28

Linq to SQL 功能以及一般的 Linq 扩展非常值得升级。

至于您对硬盘空间和安装时间的担忧,IMO,这些与更新框架的大多数现代系统无关。 框架的新版本(3.0 和 3.5)实际上只是 2.0 框架的“刷新”。 除非您的客户/市场是较旧的 PC,否则我认为您的开发团队将在功能和生产力方面获得良好的权衡,而不是失去客户的风险可以忽略不计,因为他们不能冒险在硬盘上添加另外 20Mb(我弥补了) 20mb 的号码,有人可以称之为 BS)。

The Linq to SQL features, well really pretty much the Linq Extensions in general are well worth the upgrade.

As for your worries about HD space and install time, IMO these are not relevant on most modern systems for the newer frameworks. The newer versions of the frameworks (3.0 and 3.5) are really just "refreshes" of the 2.0 framework. Unless your customers/market is older PC's I think you will get a good tradeoff in functionality and productivity for your dev team as opposed to the negligible risk of losing customers because they can't risk adding another 20Mb on their hard drive (I made up the 20mb number, someone can call BS on that).

救星 2024-07-11 07:26:28

我很欣赏 .NET 3.5 中的新语言功能,但在您使用它们之前,我会避免升级到最新的运行时,因为它是您的用户可能必须处理的较大文件/安装。

I appreciate the new language features in .NET 3.5 but until you're making use of them I would avoid upgrading to the latest runtime as it is a larger file / install that your users may have to deal with.

风吹雨成花 2024-07-11 07:26:28

我同意 EBGreen克里斯,但是我想补充一点,您可能需要考虑针对较新版本的框架测试您的应用程序,并允许您的应用程序针对您认为运行良好的那些版本运行(这可以使用一些配置技巧来完成,但不幸的是,我可以找不到它的参考)。 这样,您的应用程序就可以针对客户端可能已安装的版本运行。

我建议这样做是因为:

  1. 新的框架版本可能会给您带来性能提升。
  2. 客户的计算机上可能已经安装了另一个版本,正如您所说,浪费硬盘空间将是一种耻辱。
  3. 您可能希望在将来的某个时候针对较新的框架版本运行您的应用程序,如果您的客户端已经拥有该版本并且正在运行应用程序的当前版本,那么他们的计算机上将不会有旧的框架。

不过,我仍然缺乏您可能拥有的一些信息,例如分发方式、客户计算机的分析等。

I agree with EBGreen and Chris, but I want to add that you might want to consider testing your application against the newer versions of the framework and allow your application to run against those versions you deem to work well against (this can be done using some configuration trick, but unfortunately, I can't find reference to it). This way, your application could work against the version the client may already have installed.

I suggest this because:

  1. New framework versions may give you a performance boost.
  2. The client may already have another version installed on their computer and it would be a shame to, as you say, waste hard drive space.
  3. You may want to run your application against a newer framework version sometime in the future and if your client already has that version and is running the current version of the application, there won't be an old framework on their computer.

Still, I'm lacking some information you may have, such as the means of distribution, the profiling of clients' machines, etc.

难理解 2024-07-11 07:26:27

在我看来,您应该提供应用程序所需的内容。 否则,您将无缘无故地延长安装时间,并且正如您所指出的,基本上无缘无故地再次使用客户的硬盘空间。

In my opinion, you should ship with what your app needs. Otherwise you are making your install longer for no reason and as you noted using your customer's HD space again essentially for no reason.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文