ClickOnce won't install .NET 4.5
Solution 1
I had the same problem with an application that was set to target .net framework 4.0 in the past. First I just updated the target platform to .net framework 4.5, however the ClickOnce installer did not update its prerequisites.
What I had to do was Project Properties -> Publish -> Prerequisites -> Change from .net framework 4 to .net framework 4.5. Then 4.5 was installed during deployment.
Solution 2
I left out to mention in my question that I was upgrading from another ClickOnce application with prerequisites on .NET4.
ClickOnce prerequisites are only evaluated on the first installation so to upgrade to .NET4.5 I followed a technique described here. I.e. the old application uninstalls itself and then launches the installation of the new ClickOnce application with the new prerequisites on .NET4.5.
Process.Start("iexplore.exe", newClickOnceApplicationUrl);
Application.Current.Shutdown();
Some machines got the error message (“Please contact your system administrator.”) and some installed ok without any problems. On the machines that got the error it worked ok if the ClickOnce url was launched manually.
All users running the install were part of the Administrators group for their local machine. My theory is that the iexplorer.exe process launched from ClickOnce did not run under administrator privileges on the machines that had the problem. I did not investigate this any further though.
Solution 3
The re-installation of your application should solve the problem.
Application's ClickOnce prerequisites are checked, and, if necessary, ran, when you install your application on the machine, and not when you launch an already installed .NET application.
SteffenSH
Updated on July 26, 2022Comments
-
SteffenSH almost 2 years
I’m trying to deploy a WPF application using ClickOnce.
The project’s target framework is: “.NET Framework 4.5”.
In the VS project properties -> “Publish” -> “Prerequisites” I have checked two items:- “Microsoft .NET Framework 4.5 (x86 and x64)”
- “Windows Installer 4.5”
When I try to launch this application on a Windows 7 computer that doesn’t have .NET 4.5 preinstalled I get a popup saying:
The installation does not attempt to download/install the framework for me. It simply gives up displaying this message. The client user running the ClickOnce installation has administrator privileges on the machine.
Why doesn’t ClickOnce install .NET 4.5 automatically?
-
SteffenSH over 11 yearsYes, its an answer to my question... or at least something in the direction of an answer ;)
-
Scott over 10 yearsIn .NET 4.5, they did away with the client profile. There's only one installation of .NET 4.5, the full one. msdn.microsoft.com/en-us/library/cc656912(v=vs.110).aspx