I have a multi-project solution in which i want to automate the build process.
The building of that pipeline was successful with signing disabled.
The repository is a legacy TFVC repo which means i cannot work with yaml files unfortunately...
Now when i want to enable signing in the code en upload the new code to build it. I stumble always against the same issue.
##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3202,5): Error MSB3325: Cannot import the following key file: Key.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_0B661CF6DCF2FA7E
4>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current \Bin\Microsoft.Common.CurrentVersion.targets(3202,5): error MSB3325: Cannot import the following key file: Key.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_0B661CF6DCF2FA7E [D:\a\1\s\Brainsch\Brainsch\Brainsch.csproj]
##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3202,5): Error MSB3321: Importing key file "Key.pfx" was canceled.
The key itself in in to repository with the corresponding project.
These are the MSBuild arguments i pass in the build process:
/p:PackageCertificateThumbprint="thumbprint" /p:PackageCertificateKeyFile="$(signingCert.secureFilePath)"
If i put single quotes around the arguments like so:
'/p:PackageCertificateThumbprint="thumbprint" /p:PackageCertificateKeyFile="$(signingCert.secureFilePath)"'
I get this error:
MSBUILD : error MSB1008: Only one project can be specified.
Switch: '/p:PackageCertificateThumbprint=
How can i sign the whole solution in build process in the pipeline?