如何添加 .Net Framework 4,仅存在 4.5+

How to add .Net Framework 4, exist just 4.5+

我的程序需要 .Net Framework 4.0
当我尝试通过 VS 制作安装程序时,我无法在先决条件中选择 4.0, 我只有 4.5.2+ 或 3.5 SP1 可供选择。

我怀疑它不再作为一个选项出现,因为 Microsoft no longer supports .NET Framework 4.0。但请注意,.NET Framework 4.5.2、4.6 和 4.6.1 是 .NET Framework 4.0 的就地升级,因此您应该能够在安装程序中毫无问题地使用它们。

Will I need to recompile/rebuild my applications to make use of .NET 4.5.2, 4.6 or 4.6.1?

.NET 4.5.2, 4.6 and 4.6.1 are compatible, in-place updates on top of .NET 4, .NET 4.5, and .NET 4.5.1. This means that applications built to target any of these previous .NET 4.x versions will continue running on .NET 4.5.2 without change. No recompiling of apps is necessary.