在Visual Studio中,可以在调试时禁用对应用程序的签名吗? [英] In Visual Studio, can I disable signing my application when in debug?

查看:150
本文介绍了在Visual Studio中,可以在调试时禁用对应用程序的签名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio的项目属性->签名标签中,我已使用代码签名证书对项目进行了签名。但是,在我们团队中,即使我们处于多开发人员环境中,我也是唯一拥有代码签名证书的人。当其他开发人员尝试开始调试时,他们会收到以下消息:

In Visual Studio's Project Properties -> Signing tab, I have signed my project with a code-signing certificate. On my team, however, I'm the only one with the code-signing certificate, even though we're in a multiple-developer environment. When the other developers try to "Start Debugging", they get the following message:

找不到与项目系统指纹匹配的证书

"cannot find the certificate that matches the project system thumbprint"

有人对允许他们调试项目有任何建议,但只允许我发布吗?

Anyone have any suggestions for allowing them to debug their project, but only allow me to publish?

推荐答案

可能有用的一件事是添加构建后事件,以调用进行签名的脚本。您可以使用 signtool.exe 之类的文件进行签名

One thing that might work is adding a post-build event to call a script that does your signing. You could use something like signtool.exe to sign the files when you publish them.

您可以制作脚本文件的多个版本,例如:Debug_sign.bat,Release_sign.bat

You could make multiple versions of a script file, for instance: Debug_sign.bat, Release_sign.bat

然后在构建后事件命令行中:

调用 $(ProjectDir)$(ConfigurationName)_sign.bat

将调用正确的脚本,具体取决于您的目标。

只有发布脚本才能对输出文件进行签名。调试脚本文件什么也不能做。.




我已经使用signtool用.pfx对程序集进行了签名,如下所示:

signtool.exe标志/ f codesign_cert.pfx / p cert_password / d应用说明 / du http:/ / mywebsite myApp.exe

Then in your Post-build event command line:
call "$(ProjectDir)$(ConfigurationName)_sign.bat"
would call the correct script depending on your target.

Only the release script would actually sign the output files. The debug script file could just do nothing..

I've used signtool to sign an assembly with a .pfx like this:
signtool.exe sign /f "codesign_cert.pfx" /p "cert_password" /d "App description" /du "http://mywebsite" myApp.exe

这篇关于在Visual Studio中,可以在调试时禁用对应用程序的签名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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