What .NET Framework version should I ship with; 2,

2020-02-12 03:08发布

My application uses 2.0. At some point in the future I may want to start using newer features added in later framework versions. Should I wait until then? Or are there advantages to updating to the latest .NET 3.5 now?

I suppose by the time I am ready for next spring's release 4.0 will be out. Perhaps I should stick with 2.0 for my fall release and save my customers the HD space and install time of another framework version?

14条回答
劳资没心,怎么记你
2楼-- · 2020-02-12 03:22

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.

查看更多
Juvenile、少年°
3楼-- · 2020-02-12 03:28

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.

查看更多
smile是对你的礼貌
4楼-- · 2020-02-12 03:30

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).

查看更多
何必那么认真
5楼-- · 2020-02-12 03:34

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.

查看更多
The star\"
6楼-- · 2020-02-12 03:34

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.

查看更多
7楼-- · 2020-02-12 03:35

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.

查看更多
登录 后发表回答