.Net 4.5 是否包括 .Net 4.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15113873/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 12:09:05  来源:igfitidea点击:

does .Net 4.5 include .Net 4.0

.netdeploymentframeworksclickonce

提问by Tolga Evcimen

I am developing a C# desktop application using Winforms. I created an installation strategy using visual studios click once installation tool. Luckily it provides clients to detect, download and setup the related prerequisite components.

我正在使用 Winforms 开发 C# 桌面应用程序。我使用visual studios click once安装工具创建了一个安装策略。幸运的是,它为客户端提供了检测、下载和设置相关必备组件的功能。

My question is I started to develop this app with .NET 4.0 and then upgraded it to .NET 4.5 now on the prerequisites list both 4.5 and 4 is checked. i am wondering if i uncheck the .NET 4.0 component would it be alright?

我的问题是我开始使用 .NET 4.0 开发这个应用程序,然后在检查 4.5 和 4 的先决条件列表中将其升级到 .NET 4.5。我想知道是否取消选中 .NET 4.0 组件可以吗?

does .NET 4.5 include .NET 4.0?

.NET 4.5 是否包括 .NET 4.0?

回答by Kapil Khandelwal

When .NET 4.5 is installed it effectively replaces .NET 4.0 on the machine. .NET 4.0 gets overwritten by a new version of .NET 4.5 which - according to Microsoft - is supposed to be 100% backwards compatible.

安装 .NET 4.5 后,它有效地取代了机器上的 .NET 4.0。.NET 4.0 被新版本的 .NET 4.5 覆盖,根据微软的说法,该版本应该 100% 向后兼容。

Read these very good articles on the same:

阅读这些非常好的文章:

.NET 4.5 is an in-place replacement for .NET 4.0

.NET 4.5 是 .NET 4.0 的就地替代品

.NET Versioning and Multi-Targeting - .NET 4.5 is an in-place upgrade to .NET 4.0

.NET 版本控制和多目标 - .NET 4.5 是对 .NET 4.0 的就地升级

回答by Belial09

I think there is no need for 4.0 if you target 4.5

如果你的目标是 4.5,我认为不需要 4.0

See Installing the .NET Framework 4.5

请参阅安装 .NET Framework 4.5

The .NET Framework 4.5 replaces the .NET Framework 4. When you install the .NET Framework 4.5 on a system that has the .NET Framework 4 installed, the assemblies are replaced.*

.NET Framework 4.5 替换了 .NET Framework 4。在安装了 .NET Framework 4 的系统上安装 .NET Framework 4.5 时,程序集将被替换。*

回答by MDMoore313

It doesn't includeit per se(as some portions are overwritten), however if you target 4.0 then it should work with 4.5, but NOTvice versa.

它不包括它本身(如某些部分会被覆盖),但是如果你的目标4.0,那么它应该有4.5的工作,但不是反之亦然。

回答by eMi

You can compile an application for .NET 4.5 and run it on the 4.0 runtime – that is until you hit a new feature that doesn't exist on 4.0. At which point the app bombs at runtime. Say you write some code that is mostly .NET 4.0, but only has a few of the new features of .NET 4.5 - .NET will happily start your application and run everything 4.0 fine, until it hits that 4.5 code – and then crash unceremoniously at runtime.

您可以为 .NET 4.5 编译应用程序并在 4.0 运行时上运行它——直到您遇到 4.0 上不存在的新功能。此时应用程序会在运行时爆炸。假设您编写了一些主要是 .NET 4.0 的代码,但只有 .NET 4.5 的一些新功能 - .NET 会很高兴地启动您的应用程序并运行 4.0 的所有内容,直到它命中 4.5 代码 - 然后毫不客气地崩溃在运行时。

So, no .NET 4.5 doesnt include .NET 4.0.

因此,没有 .NET 4.5 不包含 .NET 4.0。

回答by Nogard

Answer to the question is here: http://msdn.microsoft.com/en-us/library/5a4x27ek.aspx

问题的答案在这里:http: //msdn.microsoft.com/en-us/library/5a4x27ek.aspx

Precisely:

恰恰:

?The .NET Framework 4.5 replaces the .NET Framework 4. When you install the .NET Framework 4.5 on a system that has the .NET Framework 4 installed, the assemblies are replaced.

? .NET Framework 4.5 替换了 .NET Framework 4。在安装了 .NET Framework 4 的系统上安装 .NET Framework 4.5 时,程序集将被替换。

So, no .NET 4.5 doesnt include .NET 4.0. You still have a chance that some assemblies may be missed

因此,没有 .NET 4.5 不包含 .NET 4.0。您仍然有可能错过某些程序集