I have a project hosted in Azure DevOps and there the build is failing with the error message:
Error MSB3325: Cannot import the following key file: xxxx.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_xxxx
This happens after a project has been changed to sign the assembly with a newly generated password protected pfx signing certificate.
I have tried various fixes given in other SO posts and nothing seems to work.
Can anyone with azure-devops expertise help me with this situation.
You can create a
PowerShellscript and add a PowerShell Script step in your build definition to import the new certificate file before the VSBuild step:The PowerShell script I used to use:
And it works fine on my side.
You can check the similar thread for some more details.
Hope this helps.