发布时签署ClickOnce应用程序中执行, [英] Sign executable within a clickonce application when publishing

查看:165
本文介绍了发布时签署ClickOnce应用程序中执行,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2013年我已经成功地签署了清单告诉Visual Studio中也签署程序集的C#.NET项目。

I have a c# .net project in Visual Studio 2013. I have successfully signed the manifest told Visual studio to also sign the assembly.

然而,应用程序的exe文件不被签署。谷歌搜索后,我增加了以下到后生成事件

However the application exe file is not being signed. After googling I added the following to the post build event

"C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" sign /f "$(ProjectDir)certificate.pfx" /p mypassword "$(ProjectDir)obj\Debug\myapp.exe"

和也试过

"C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" sign /f "$(ProjectDir)certificate.pfx" /p mypassword "$(ProjectDir)bin\Debug\myapp.exe"

这似乎签署exe文件,但现在我的应用程序将不会启动并给出错误:

That seems to sign the exe, however now my application won't launch and gives the error:

文件,心电图动态心电图云Assistant.exe,比在清单中指定一个不同的计算出的散列

File, ECG Cloud Holter Assistant.exe, has a different computed hash than specified in manifest.

所以我想我需要它签署exe文件的 的它生成清单之前,但我该怎么办去做?

So I think I need it to sign the exe before it generates the manifest but how do I do that?

如果我不包括后生成命令,应用程序运行正常,但有一个未知发布者警告。

If I don't include the post build command, the app runs ok but with an unknown publisher warning.

推荐答案

先给这个一杆:结果
1.在WinForms项目单击鼠标右键,选择卸载项目结果
2。该项目再次右键单击,然后选择编辑(命名为yourprojectname)的.csproj结果
3.转到文件的底部和闭幕项目标签前添加以下部分:结果

Try giving this a shot:
1. Right-click on the winforms project and select "Unload Project".
2. Right-click on the project again and select "Edit (yourprojectname).csproj".
3. Go to the bottom of the file and add the following section before the closing "Project" tag:

<Target Name="AfterCompile">
   <Exec Command="C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" sign /f "$(ProjectDir)certificate.pfx" /p mypassword "$(ProjectDir)obj\Debug\myapp.exe" />
</Target>



4。保存该凸出文件并关闭它。结果
5.该项目再次右键单击并重新加载它。搜索结果
现在,如果你建立你的项目,你不会看到关于在输出窗口签署应用程序的可执行什么。它只会做,如果你发布,并且不会有记录,让你知道它签了字。你怎么知道它的工作?转到您发布到该文件夹​​,并查看应用程序文件文件夹。在文件夹中的应用程序的可执行文件的新版本。上单击鼠标右键,选择属性。寻找一个名为数字签名选项卡。如果它没有找到,它没有签名。如果你看到它,去到该选项卡;它会显示签名列表和证书的签名。上签名,你可以双击,然后查看签名证书。
搜索结果
我也有类似的问题,并能够从这篇博客的帮助来弄明白:的 https://robindotnet.wordpress.com/2013/02/24/windows-8-and-clickonce -the-明确的回答-2 /

这篇关于发布时签署ClickOnce应用程序中执行,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆