已安装 4.5 时,不会安装 .NET Framework 4.0 [英] .NET Framework 4.0 does not install when 4.5 is already installed
问题描述
我将 Visual Studio 2012 用于需要(至少).NET Framework 4.0 的 WPF 项目.我已经安装了 4.5,但使用 Windows XP 的人无法安装该应用程序(因为 4.5 不能在 Windows XP 上运行).我使用 ClickOnce 作为部署应用程序.
I use Visual Studio 2012 for a WPF project needing (at least) .NET Framework 4.0. I have 4.5 already installed, but people with Windows XP cannot install the application (because 4.5 does not run on Windows XP). I use ClickOnce as the deployment application.
当我尝试安装 4.0 版本时,出现错误(从荷兰语翻译,因此英文版本可能会有所不同):
When I try to intall version 4.0, I get the error (translated from Dutch so the English version might be a bit different):
此计算机上已安装相同或更高版本的 .NET Framework 4
The same or a higher version of .NET Framework 4 is already installed on this computer
我该如何解决这个问题?
How can I fix this?
推荐答案
.NET 4.5 是 .NET 4.0 的附加组件 CLR,因此,当您安装 .NET 4.5 时,它包括 4.0.在安装了 .NET 4.5 的机器上生成 ClickOnce 时存在一个已知问题.
.NET 4.5 is an add-on to .NET 4.0 in terms of the CLR, and as such, when you install .NET 4.5, it includes 4.0. There is a known issue with ClickOnce when it is generated on a machine that has .NET 4.5 installed.
Visual Studio 2012 Update 1 应该可以解决这个问题.
Visual Studio 2012 Update 1 is supposed to fix this issue.
您可以在 Visual Studio 中为 .NET 应用程序设置 .NET 框架版本.当您要发布 Windows XP 兼容版本时,应始终选择 .NET 4 或更低版本作为目标框架.
You can set the .NET framework version for your .NET applications inside Visual Studio. When you want to publish a Windows XP compatible version, you should always select .NET 4 or lower as the target framework.
.NET 4.0 Framework 应与 4.5 一起列出.
The .NET 4.0 Framework should be listed side by side with 4.5.
这是在正常安装的 Windows 8 机器上,Visual Studio 2012 Ultimate,无需安装任何其他框架或 SDK.
This is on a normally installed Windows 8 machine, Visual Studio 2012 Ultimate, without having to install any other framework or SDK.
这篇关于已安装 4.5 时,不会安装 .NET Framework 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!