I'm trying to automate all the build & release process in our company and I'm struggling with a very small step: the PFX key import in the local machine. For example we have a new build machine and the code we want to build is signed during the build via a PFX file that is password-protected. When I run the build in TFS on this machine the build fails with this error
Error MSB3325: Cannot import the following key file: Mykey.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_03AD4638FE10A12F
Good, as stated here I only have to import the PFX file in the container named VS_KEY_03AD4638FE10A12F
...but this is a manual step required after a first failed build occours, and I need it to fail to know the container name to use for the key import via sn.exe
.
Instead, I would like to provide a build machine that is already able to compile the code.
How is that container name generated? Is there any way to tell in the source code a fixed container to use so that it does not change each time a new machine is used to build? Or, can we retrieve the key container that will be used before the build so that I add a build step that imports the PFX file? Or moreover, is there any "generic" key container I can use (that will be the same for all the machines)?
Thank you