wpf 签名时发生错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14070767/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
An error occurred while signing
提问by David Shochet
I maintain a large WPF application which I inherited from another developer. I use ClickOnce to publish it. Suddenly, today I got an error message:
Error 2 Cannot publish because a project failed to build. 1 1
Error 3 An error occurred while signing: Failed to sign bin\Debug\app.publish\setup.exe. SignTool Error: No certificates were found that met all the given criteria.
我维护了一个从另一个开发人员那里继承的大型 WPF 应用程序。我使用 ClickOnce 发布它。突然,今天我收到一条错误消息:错误 2 无法发布,因为项目无法构建。1 1
错误 3 签名时发生错误:无法对 bin\Debug\app.publish\setup.exe 进行签名。SignTool 错误:未找到满足所有给定条件的证书。
I do have a file called SomeName.snk, which is referred in project settings, Signing tab. I have no idea what happened today that caused the problem. I use VS 2012.
我确实有一个名为 SomeName.snk 的文件,它在项目设置的签名选项卡中引用。我不知道今天发生了什么导致了这个问题。我使用 VS 2012。
采纳答案by Judah Gabriel Himango
I'd check whether the certificate expired. Most (all?) certs have an expiration date.
我会检查证书是否过期。大多数(全部?)证书都有有效期。
回答by Antoine Meltzheim
Go to main project properties> Signing> If the expiration date is over > click on Create Test Certificate, password is not mandatory, and you're done.
转到主项目属性>签名> 如果到期日期已过 > 单击创建测试证书,密码不是必需的,您就完成了。
回答by paparazzo
Did you check for the certificate?
你检查证书了吗?
View or manage your certificates
You can use the MMC Snap In or Internet Explorer.
您可以使用 MMC 管理单元或 Internet Explorer。
回答by motodiver
Go to main project properties > Signing > Select from Store...
Click certificate properties
And install certificate
转到主项目属性 > 签名 > 从商店中选择...
单击证书属性
并安装证书
回答by SilentNot
I got this problem installing visual c++ on top of a VS2017 .net install. I solved it by unchecking Properties -> Security -> Enable ClickOnce security settings.
我在 VS2017 .net 安装之上安装 Visual C++ 时遇到了这个问题。我通过取消选中属性 -> 安全 -> 启用 ClickOnce 安全设置来解决它。
It then created an app.manifest file. After that the error went away. Interestingly enough, I checked it again to see what would happen and the problem did not come back.
然后它创建了一个 app.manifest 文件。在那之后,错误消失了。有趣的是,我再次检查了它,看看会发生什么,问题没有再出现。
回答by UnhandledExcepSean
I just ran into the problem today. In my particular case, it was caused by this Microsoft Windows Update.
我今天刚遇到这个问题。在我的特殊情况下,它是由这个Microsoft Windows Update引起的。
I uninstalled that update and publish began working as it always had. This is only a temporary work around and means you should probably regenerate your keys/certificates.
我卸载了该更新并发布开始像往常一样工作。这只是一个临时解决方法,意味着您可能应该重新生成您的密钥/证书。
回答by DevRajneesh
This happens mostly if your certificate for that particular project has expired or has some issues.
如果您的特定项目的证书已过期或存在一些问题,通常会发生这种情况。
Right Click Project -> Properties -> Signing Tab -> More Details button -> Shows your certificate details. Check if your certificate has expired
右键单击项目 -> 属性 -> 签名选项卡 -> 更多详细信息按钮 -> 显示您的证书详细信息。检查您的证书是否已过期
Ways to Fix
修复方法
1. Un-check the "Sign the ClickOnce manifests" and try
1. 取消选中“签署 ClickOnce 清单”并尝试
2. Extend the Certificate by creating a Test Certificate (If your certificate is expired)
2.通过创建测试证书来扩展证书(如果您的证书已过期)
- Hit "Create Test Certificate..." button
- Enter your credentials (Not mandatory)
- Save
- 点击“创建测试证书...”按钮
- 输入您的凭据(非强制性)
- 节省
3. Re-validate your existing certificate (If your certificate is not expired)
3. 重新验证您现有的证书(如果您的证书未过期)
- Hit "Select from file" button and use your existing key file (eg. .pfx)
- 点击“从文件中选择”按钮并使用您现有的密钥文件(例如.pfx)
OR
或者
- Hit "Select from Store" button and select from the available options
- 点击“从商店中选择”按钮并从可用选项中进行选择
Tip:If you still face issues building the project. Just restart your Visual Studio.
提示:如果您在构建项目时仍然遇到问题。只需重新启动您的 Visual Studio。
Hope that helps.
希望有帮助。
回答by gusmally supports Monica
In my case, the cert was not expired and none of the other solutions worked (restarting VS, using a temp test cert, restarting computer, etc.)
在我的情况下,证书没有过期,其他解决方案都不起作用(重新启动 VS、使用临时测试证书、重新启动计算机等)
The issue was resolved by deleting my output directory and rebuilding.
通过删除我的输出目录并重建.
回答by Nxt_N_C
Go to Main project (Startup Project) and right click > properties Then go to Signing Then unchecked "Sign the ClickOnce manifests" It's work for me.
转到主项目(启动项目)并右键单击> 属性然后转到签名然后取消选中“签署 ClickOnce 清单”这对我有用。