开发者

.net framework versions (or what runs what?)

开发者 https://www.devze.com 2023-01-07 00:55 出处:网络
OK, this is rather broad question but ... Is there a chart that says what version of the framework will run what?

OK, this is rather broad question but ... Is there a chart that says what version of the framework will run what?

So, I guess it brakes down into two questions

1 - Are the frameworks 100% backward compatible? I've had a Framework 2.0 Website run 1.1 dlls, so I assume 2.0 will run 1.1. Will this work for a windows app? Will it work for all versions?

2 - Is a framework ever forward compatible? I know the reverse of above will not work but will it work for any set of versions?

So, how important is it to keep the versions on your clien开发者_如何学编程ts' machines synced with your build version?

Is there a best pratice in the .net community on how to make your software work for the most number of clients without forcing non-technical users to download newer/different versions of the .net framework?


As a rule of thumb, if .NET version X installs side-by-side with .NET version Y, then .NET version X is not compatible (backwards or forwards) with .NET version Y. This is a rule I've been using for quite some time (since .NET 2.0 came out). It's probably too safe for small-scale applications, but it's better to be safe than sorry.

Here are some concrete examples:

  • .NET 4.0 will not run .NET 3.x or earlier applications properly
  • .NET 3.5 will run .NET 3.0 & .NET 2.0 applications, but not .NET 1.1
  • .NET 3.0 will run .NET 2.0 applications, but not .NET 1.1
  • .NET 2.0 will not run .NET 1.1

  • .NET 4.0 installs side-by-side with .NET 3.5/3.0/2.0 and with .NET 1.1

  • .NET 3.5, 3.0, and 2.0 do not install side-by-side with each other
  • .NET 3.5/3.0/2.0 installs side-by-side with .NET 1.1

Hope this helps.


IMO, the "major" versions to date are:

  • 1.0
  • 1.1
  • 2.0, 3.0, 3.5 (I believe these were split out due to major C# extensions)
  • 4.0

Frameworks on different lines install side-by-side and do not run each other; those on the same line can be used interchangeably so long as the host machine has at least the version of the assembly installed.

All .NET versions currently come with Windows - they are now considered part of the operating system and follow its life cycle. (See http://support.microsoft.com/lifecycle/search/?alpha=.NET+Framework&sort=PN) If your users have been keeping their computer up-to-date, you should have no problems using the latest .NET Framework version.

Make sure that, for your configuration files later than 1.0, you include the <supportedRuntime> element: http://msdn.microsoft.com/en-us/library/w4atty68.aspx

As Jim Schubert mentions in his comment, your C# code may compile on later versions, but there are some breaking changes.


Haven't seen a chart anywhere but generally, you don't worry about backwards compatibility. The only important thing is making sure that your clients have the minimum framework installed.

And no, none of the .NET versions are forward compatible.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号