Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

visual studio 2012 - .NET Framework 4.0 does not install when 4.5 is already installed

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.

When I try to intall version 4.0, I get the error (translated from Dutch so the English version might be a bit different):

The same or a higher version of .NET Framework 4 is already installed on this computer

How can I fix this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

.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 is supposed to fix this issue.

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.

The .NET 4.0 Framework should be listed side by side with 4.5.

Enter image description here

This is on a normally installed Windows 8 machine, Visual Studio 2012 Ultimate, without having to install any other framework or SDK.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...