tag:help.appveyor.com,2012-11-13:/discussions/problems/27491-cannot-load-pfx-keyAppVeyor: Discussion 2020-08-06T21:03:12Ztag:help.appveyor.com,2012-11-13:Comment/483864252020-06-05T23:56:45Z2020-06-05T23:56:45ZCannot load PFX key for assembly signing<div><p>Never seen such an error before. Try looking via RDP how the cert is installed: <a href="https://www.appveyor.com/docs/how-to/rdp-to-build-worker/">https://www.appveyor.com/docs/how-to/rdp-to-build-worker/</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/483864252020-06-06T00:43:57Z2020-06-06T00:44:07ZCannot load PFX key for assembly signing<div><p>After some more digging I fixed it by using this script:</p>
<p><a href="https://github.com/camalot/madb/blob/master/.appveyor/modules/Import-PfxCertificate.psm1">https://github.com/camalot/madb/blob/master/.appveyor/modules/Impor...</a></p>
<p>Loading PFX files isn't as simple as it should be.</p>
<p>Apparently this problem has already popped up here some time ago: <a href="https://help.appveyor.com/discussions/problems/1350-strange-behaviour-with-secure-variables">https://help.appveyor.com/discussions/problems/1350-strange-behavio...</a>.</p>
<p>Strange to have to use such complicated scripts for trivial tasks like signing assemblies. Anyway, it's working now.</p></div>murarialextag:help.appveyor.com,2012-11-13:Comment/483864252020-06-06T00:47:34Z2020-06-06T00:47:34ZCannot load PFX key for assembly signing<div><p>Maybe it depends on the certificate, as in our internal builds we are importing AppVeyor's signing certificate with just <code>Import-PfxCertificate</code>. However, we are signing with <code>signtool.exe</code>, not during the build, so this might be the difference as well.</p></div>Feodor Fitsner