加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 当文件位于必须的位置时,ClickOnce无法找到其先决条件

发布时间:2020-12-15 08:47:11 所属栏目:百科 来源:网络整理
导读:我想使用 ClickOnce发布我的应用程序以及一些先决条件(.NET 4.5和 SQL Server Express). 我在How to: Include Prerequisites with a ClickOnce Application中说过(注意包文件夹是在v8.1A文件夹而不是v8A文件夹中),但它仍然说它找不到文件.我已经尝试了Visual
我想使用 ClickOnce发布我的应用程序以及一些先决条件(.NET 4.5和 SQL Server Express).

我在How to: Include Prerequisites with a ClickOnce Application中说过(注意包文件夹是在v8.1A文件夹而不是v8A文件夹中),但它仍然说它找不到文件.我已经尝试了VisualStudio2013和VisualStudio2015 RC.

To enable ‘Download prerequisites from the same location as my application’ in the Prerequisites dialog box,you must download file ‘DotNetFX45dotNetFx45_Full_x86_x64.exe’ for item ‘Microsoft .NET Framework 4.5 (x86 and x64)’ to your local machine. For more information,see 07005.

To enable ‘Download prerequisites from the same location as my application’ in the Prerequisites dialog box,you must download file ‘SqlExpress2012SQLEXPR32_x86_ENU.EXE’ for item ‘SQL Server 2012 Express’ to your local machine. For more information,you must download file ‘SqlExpress2012SQLEXPR_x64_ENU.EXE’ for item ‘SQL Server 2012 Express’ to your local machine. For more information,you must download file ‘DotNetFX40ClientKB2468871dotNetFx40_Client_x86_x64.exe’ for item ‘Microsoft .NET Framework 4 Client Profile (x86 and x64) and Update for .NET Framework 4 (KB2468871)’ to your local machine. For more information,see 07005.

解决方法

您对ClickOnce部署中的可能性有一个非常错误的想法.规范的MSDN页面是 this one.高亮显示该网页中最重要的部分:

Impact to the user’s computer. With Windows Installer deployment,applications often rely on shared components,with the potential for versioning conflicts; with ClickOnce deployment,each application is self-contained and cannot interfere with other applications.
Security permissions. Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.

Does not affect shared components or other applications: Yes
Installation of shared files: No
Installation to Global Assembly Cache: No
Installation for multiple users: No
Install time registry access: Limited

这些故意限制旨在让用户对使用ClickOnce安装.NET程序感觉良好.他们不需要管理员的帮助来安装程序.并且安装程序无法对机器进行大幅更改,导致其他程序出现故障.安装人员非常非常常见的问题.

这与你要做的事情完全不相容. .NET Framework和SQL Express都是共享组件,并且需要管理员访问才能安装,并且可能会破坏已安装.NET或SQL Server的计算机的稳定性.

所以这根本行不通.您可以选择它们作为先决条件,但安装时发生的所有事情都是ClickOnce安装程序验证它们是否符合要求.换句话说,该机器必须已安装正确版本的.NET和SQL Express.如果没有,那么部署将失败,用户将获得告诉他下载安装程序位置的对话框.然后完全取决于他(或他的管理员)下载并运行安装程序.之后,您的ClickOnce安装完成没有问题.

部署向导非常糟糕,它应该隐藏底部的单选按钮.只有“来自组件供应商的网站”才是这些先决条件的有效选择.引导程序.xml文件格式不够复杂,无法限制选择.

如果您想为用户提供安装程序附带的这些先决条件,那么获得优先权的唯一方法是创建一个普通的MSI安装程序.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读