本文介绍了ClickOnce 不会安装 .NET 4.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ClickOnce 部署 WPF 应用程序.
项目的目标框架是:.NET Framework 4.5".
在 VS 项目属性 -> 发布" -> 先决条件"中我检查了两个项目:

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 和 x64)"
  • Windows 安装程序 4.5"

当我尝试在未预装 .NET 4.5 的 Windows 7 计算机上启动此应用程序时,我收到一个弹出窗口:

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:

安装不会尝试为我下载/安装框架.它只是放弃显示此消息.运行 ClickOnce 安装的客户端用户在机器上拥有管理员权限.

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.

为什么 ClickOnce 不自动安装 .NET 4.5?

Why doesn’t ClickOnce install .NET 4.5 automatically?

推荐答案

我在过去设置为面向 .net framework 4.0 的应用程序中遇到了同样的问题.首先,我只是将目标平台更新为 .net framework 4.5,但是 ClickOnce 安装程序没有更新其先决条件.

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.

我必须做的是项目属性 -> 发布 -> 先决条件 -> 从 .net framework 4 更改为 .net framework 4.5.然后在部署过程中安装了 4.5.

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.

这篇关于ClickOnce 不会安装 .NET 4.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 23:36