I had successfully used strong name signing in our code for years but now we got a new certificate.
Now whenever I try to build one of our .net library assemblys I get error MSB3325, the key could not be imported it might be password protected.
Indeed, it is.
So following Visual Studios suggestion I manually import the key:
sn -i MyKey.pfx VS_SomeHash
This gives a success message.
Build again => same error MSB3325 again.
So I try to import the key again:
sn -i MyKey.pfx VS_SomeHash
Failure: The keypair could not not be installed, the object already exists
Well after a while I tried to double check if I imported the correct key, so I tried to re-export the public key from the above mentioned container:
sn -pc VS_SomeHash publicKey.foo
But I get the error message that the public key can not be exported because the key does not exists in the container.
Can anyone tell me how to get this working? If possible without having to change the build process to use signtool?
I have already tried everything as normal user, as admin, I deleted the container, and I also tried switching from machine wide storage to user specific storage (sn -m n). So far nothing helped.
I already thought about debugging the ResolveKeySource Task of msbuild but so far I did not find a way to debug it.
Any help would be appreciated. Thanks.