问题描述
我从Visual Studio 2012发布了ClickOnce应用程序,并选择了.NET 4.0运行时和Microsoft Report Viewer 2012作为先决条件.我还选择从供应商的网站下载必备软件.
I published a ClickOnce application from Visual Studio 2012, and selected the .NET 4.0 runtime and Microsoft Report Viewer 2012 as prerequisites. I also selected to download the prerequisites from the vendor's website.
当我尝试在客户端PC上安装应用程序时,出现以下错误:
When I try to install the application on a client PC, I receive the following error:
该日志未提供其他详细信息.
The log provides no additional details.
如果手动安装.NET运行时,则再次运行Setup.exe时,报告查看器也会收到相同的错误.
If I manually install the .NET runtime, then I receive the same error for the report viewer when I run the Setup.exe again.
是什么原因导致此错误,以及如何防止其发生?
What causes this error and how do I prevent it from happening?
推荐答案
从Microsoft下载的文件具有不同于引导程序配置文件(Product.xml)中指定的公共密钥.至少其中一些已在VS 2012发布后发布,并且必须使用其他密钥签名.我必须从数字签名证书中提取公共密钥,并用它替换product.xml文件中指定的公共密钥.在此之后,它运行良好.
The files that were downloaded from Microsoft had a different public key than what was specified in the bootstrapper configuration files (Product.xml). At least some of them had been published after VS 2012 was released and must have been signed with a different key. I had to extract the public key from the digital signature certificate and use it to replace the public key specified in the product.xml file. After this, it worked fine.
要提取公钥:
- 右键单击安装程序可执行文件,然后单击
Properties
. - 点击
Digital Signatures
标签. - 从列表中选择签名,然后单击
Details
按钮. - 在
General
选项卡上,单击View Certificate
按钮. - 在
Certificate
窗口中,单击Details
选项卡,然后找到名为Public Key
的字段. - 突出显示并复制数据.您将需要运行查找/替换以删除空格.
- 将此密钥粘贴到此安装程序包的
Product.xml
文件的公共密钥属性中.
- Right click on the installer executable and click
Properties
. - Click the
Digital Signatures
tab. - Select the signature from the list and click the
Details
button. - On the
General
tab, click theView Certificate
button. - In the
Certificate
window, click theDetails
tab and locate the field calledPublic Key
. - Highlight and copy the data. You will need to run a find/replace to remove the blank spaces.
- Paste this key into the public key attribute in the
Product.xml
file for this installer package.
这篇关于从VS 2012发布ClickOnce应用程序后,下载必备软件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!