从 .NET 1.1 迁移到 .NET 3.5

发布于 2024-07-10 21:07:02 字数 52 浏览 5 评论 0原文

将 Web 应用程序从 .NET 1.1 升级到 .NET 3.5 有哪些令人信服的理由?

What would be some compelling reasons to upgrade a web app from .NET 1.1 to .NET 3.5?

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

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

发布评论

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

评论(9

焚却相思 2024-07-17 21:07:02

问题不是“是否应该”——就功能和添加的编译时检查而言;而是“是否应该”。 跳出1.1框架进入2.0框架几乎是理所当然的事情。 问题是,您应该以多快的速度移植? 需要改变什么?

您的第一步是将应用程序移植到 .NET 2.0。 原因是.NET 2.0 中有很多以前不存在的功能,并且以前的功能已被弃用。 (在 ASP.NET 中,有大量功能在 2.0 中已弃用)。

.NET 2.0 允许更强的类型安全性、可为 null 的类型以及框架中的更改。 2.0 代表(我认为).NET 平台的第一个“真正”版本。 它是一个强有力的竞争者,您会发现您在 1.1 中使用的一些框架内容已在 2.0 中进行了修改。

这不是一个简单的“移植代码并获得好处”的场景。 如果你想要这些好处,你将不得不重写一些代码(最值得注意的是,涉及泛型的东西); 但即使在更大的 .NET 框架中,也有很多“幕后更改”,您需要逐步移植它:不要直接从 1.1 跳转到 3.5。

1.1 - 2.0

.NET 2.0 和 .NET 3.0 之间存在大量变化。 整个范式发生了转变。 (尽管无可否认这是自愿的转变)。
维基百科有一整节专门介绍它,但我会(一些!)此处的更改:

.NET Framework 更改

  • Windows Presentation Foundation (WPF)
  • Windows Communication Foundation (WCF)
  • Windows Workflow Foundation
  • Windows CardSpace

C# 更改

  • LINQ
  • 对象初始化器
  • 集合初始化器
  • 匿名类型
  • Lambda 表达式
  • 自动属性
  • ​​扩展方法
    (来源:维基百科

显然,还会有更多内容。 仅从 1.1 到 2.0 的跳跃就值得整个发布周期。

The question isn't 'whether you should',-- in terms of features and added compile-time checks; it's almost a given to get out of the 1.1 framework and into the 2.0 framework. The question is, how fast should you port? What would need to be changed?

Your first step would be to port your application to .NET 2.0. The reason is is that there are plenty of features in .NET 2.0 that didn't exist before, and previous features were deprecated. (In ASP.NET, there were a slew of features deprecated in 2.0).

.NET 2.0 allows for stronger type-safety, nullable types, and changes in the framework. 2.0 represents (what I would consider) the first 'real' release of the .NET platform. It is a serious contender, and you'll find that some of the framework stuff you use in 1.1 has been modified in 2.0.

It's not a simple 'port the code forward and get the benefits' scenario. If you want the benefits, you'll have to rewrite some code (most notably, things involving Generics); but even in the larger .NET framework, there are so many 'behind the scenes changes' that you'll want to port it incrementally: Don't make the jump directly from 1.1 - 3.5.

1.1 - 2.0

There are a slew of changes between .NET 2.0 and .NET 3.0. There was an entire paradigm shift. (Though admittedly it is a voluntary shift).
Wikipedia has an entire section devoted to it, but I'll (some!) of the changes here:

.NET Framework changes

  • Windows Presentation Foundation (WPF)
  • Windows Communication Foundation (WCF)
  • Windows Workflow Foundation
  • Windows CardSpace

C# Changes:

  • LINQ
  • Object Initalizers
  • Collection Initalizers
  • Anonymous Types
  • Lambda Expressions
  • Automatic Properties
  • Extension Methods
    (Source: Wikipedia)

More to come, obviously. Just the jump from 1.1 to 2.0 is worth an entire release cycle.

铜锣湾横着走 2024-07-17 21:07:02

.net 1.1 已弃用,不再进一步开发。 我不确定安全问题。 但总的来说,它被放弃了,从 2.0 开始,微软确保了较新版本的向后兼容性,而 1.1 则不然。

所以,如果你有机会搬家,那就搬家吧。 你会得到新的语言特性,你会得到一个不断构建的框架。 如果需要的话,您可以获得 linq、silverlight 支持、当然还有泛型等等。

.net 1.1 is deprecated, not being further developed. i'm not sure about security issues. but in general, it's abandoned, and as of 2.0 microsoft ensures back-compatibility in newer versions which isn't the case to 1.1.

so if you have a chance to move - move. you get new language features, you get a framework being constantly built further and further. you get linq if you need it, silverlight support, generics of course, etc.

落叶缤纷 2024-07-17 21:07:02

实际上,我最近完成了将整个代码库从 .NET 1.1 转换为 .NET 2.0。 考虑到 .NET 3.5 实际上只是 .NET 2.0 的扩展集,它并不是一个全新的基础。

在很多方面,差异确实相当大。 对我来说,.NET 1.1 并没有以任何方式被“驯服”,并且需要大量的代码。 此外,VS 7 必须针对 .NET 1.1 使用,因此需要较旧的工具。

对于 Web 应用程序,需要不同的 Web 配置,因为它公开了 .NET 版本,这使得它更加混乱。 不要陷入“.NET 3.5 有新功能,因此我必须转向它”的想法,因为您必须根据需求而不是潜在的工具用途做出决定。 正如许多作者正确指出的那样,您很可能不会使用构成整个框架的一半功能。

另一方面,我建议至少从 .NET 1.1 转向 .NET 2.0。

I've actually recently finished converting an entire code-base from .NET 1.1 to .NET 2.0. Take into account that .NET 3.5 is actually just sets of extensions for .NET 2.0, it's not a completely new base.

The difference is really quite substantial in many parts. To me, .NET 1.1 had not been "tamed" in any way whatsoever, and required an awful amount of code. Furthermore, VS 7 had to be used against .NET 1.1, so older tools were required.

For web apps a different web config was required as it exposes the .NET version which made it even messier. Don't get into the ".NET 3.5 has new features therefore I must move to it" motion, because you have to make the decision based on requirements, not on potential tool uses. As many-an-author rightly points out, there's a good chance you won't use half of the features that compose the entire framework.

I would recommend, on the other hand, to shift from .NET 1.1 to .NET 2.0 at least.

仙气飘飘 2024-07-17 21:07:02

泛型、lambda、LINQ,还有许多其他我肯定已经忘记的东西。

Generics, lambdas, LINQ, many others that I forgot about I'm sure.

暮年 2024-07-17 21:07:02

升级到 .NET 3.5 有许多令人信服的理由。 然而,正如其他人指出的那样,3.5 很大程度上(如果不是全部)只不过是 2.0 的扩展; 然而,2.0 带来了大量的功能,非常值得迁移。 话虽如此,在我看来,如果您要进行迁移,那么迁移到 2.0 而不仅仅是迁移到 3.5 似乎有点愚蠢。

单独的扩展方法非常有用。 我发现自己使用它们的频率比我想象的要高得多。 此外,3.5 中的许多新功能都是基于它们的。 泛型极大地简化了我们的开发工作; 而且,如果您使用 C# 进行编码,自动 setter 和 getter 会是一个福音。 Lambda 表达式对我来说仍然相对较新,因此我无法与它们交谈,但我知道其他人发现它们特别有用。

WPF 提供了一种编写应用程序的全新方式,我已经使用过它。 它显示出巨大的希望; 不幸的是,它似乎还没有得到我(个人)认为它应有的广泛采用。 希望这种情况会随着时间的推移而改变,但这将取决于微软本身是否开始更积极地推动它。

就框架本身而言,我发现许多功能得到了改进或提供了 1.1 中以前缺失的功能; 随着它的成熟,Framewok 似乎正在朝着一个方向发展,即要求我们为我们通常执行的任务(例如目录服务、FTP 访问、命名管道等)编写更少的代码。 粗糙的边缘变得更加光滑。

因此,简而言之:迁移到 3.5 意味着您可以使用更少的代码编写较新的应用程序,并且可以重构现有应用程序以使用更少的代码(并不是说我建议仅出于此目的这样做)。 3.5 提供多种生产力工具供您使用; 我个人的观点是,仅凭这些工具就值得向前迈进。

但是,就像任何业务决策一样,您必须根据项目的状态以及移植代码库时可能出现的任何潜在缺陷来权衡所有这些。 迄今为止,我的经验是我们遇到了一些障碍,但还不足以使整个行动戛然而止。 尽管如此,在任何迁移中,代码总是有可能被破坏。 必须牢记这一点。

There are a number of compelling reasons for upgrading to .NET 3.5. As others have pointed out, however, 3.5 is largely (if not wholly) nothing more than extensions to 2.0; however, 2.0 brings a large number of features to the table that make it well worth the move. That being said, in my mind, if you're going to make the move, it seems kind of silly to move to 2.0 and not just move to 3.5.

Extension methods alone are extraordinarily useful. I find myself using them far more frequently than I thought I would. Further, many of the newer features in 3.5 are based on them. Generics vastly simplify a great deal of our development; and, if you're coding in C#, automatic setters and getters are a boon. Lambda expressions are still relatively new for me, so I can't speak to them, but I understand that others find them particularly useful.

WPF presents a whole new way of writing applications, and I have used it. It shows great promise; unfortunately, it doesn't appear to be getting the wide adoption that I (personally) think it deserves yet. Hopefully, that'll change with time, but that will depend on whether or not Microsoft itself begins pushing it more aggressively.

As far as the Framework itself is concerned, I find that much functionality is improved or provided that was previously missing from 1.1; as it matures, the Framewok seems to be heading in a direction that requires us to write less code for those tasks that we commonly perform (such as directory services, FTP access, named pipes, and so on). The rough edges are getting smoother.

So, in short: moving to 3.5 would mean that your newer applications could be written with less code, and existing applications could be refactored to use less code (not that I'd recommend doing so solely for that purpose). 3.5 puts a wide array of productivity tools at your disposal; my personal opinion is that those tools alone make it well worth the leap forward.

But, like any business decision, you have to weigh all that against the state of your projects--and any potential defects that might arise when you port the codebase. My experience to date has been that we ran into a few snags, but not enough to bring the entire operation to a screeching halt. Nonetheless, with any migration, there is always the possibility that code will break; that has to be born in mind.

老娘不死你永远是小三 2024-07-17 21:07:02

最大的区别是您要迁移到 .NET 2.0 CLR(这与当前运行的 .NET 是同一个 CLr)。

这意味着您拥有大量的错误修复和 CLR 级别的泛型支持。 其余的更改只是对基础类库的更改以及编译器中的新语言功能。

The biggest difference is that you are moving to the .NET 2.0 CLR (This is the same CLr that the current .NET is running on).

This means you have an abundance of bugfixes, and CLR level Generics support. They rest of the changes are just changes to the foundation class libraries, and new languages features in the compilers.

时光与爱终年不遇 2024-07-17 21:07:02

我认为一个很好的理由是 ASP.NET 2.0 及更高版本中设置的提供程序框架。 能够获取用户是否已登录或用户拥有的角色列表,而无需担心用于检查这些内容的底层机制,这是一个很大的好处。

I think a really good reason is the provider frameworks set up in ASP.NET 2.0 and later. The ability to get whether a user is logged in or a list of roles that a user has without worrying about the underlying mechanism that's used to check those things is a big benefit.

苏别ゝ 2024-07-17 21:07:02

不要忘记 WCF、WF、WPF、CardSpace 等。

Don't forget about WCF, WF, WPF, CardSpace, etc.

平生欢 2024-07-17 21:07:02

编辑并继续? 泛型和可为 null 的类型也让生活变得更轻松!

Edit and continue? Also generics and nullable types makes life a little easier!

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