if I like, you are not using TFS or MSBUILD to build, then there are at least two other ways:
a) run sn.exe from the script and write the password for stdin
see here for an example of C #:
Note: with sn.exe.NET4 it seems impossible to execute it as an external process (at least in Windows XP) and write a password for stdin (I tried with python + with C # and sn.exe seems to just exit, not waiting for the password to be entered).
b) use sn.exe to re-sign the password using pfx already installed.
If you have already installed the pfx file, you can find out the name of the container (usually Visual Studio uses the name VS_KEY_ABAB1234ABAB1234)
If, like me, you donβt know or donβt remember the name of the container, just reinstall the pfx file:
sn -i myPfxFile VS_KEY_ABAB1234ABAB1234
sn.exe will prompt you to enter a password because it installs the certificate in the pfx file.
You can then make sn.exe a re-subscription of your assembly without any password hints:
sn -Rca myAssembly.dll myVSkey
The above can be used in the build script, since interaction is not required :-)
NB do not forget to check if the signature really works:
sn -v myAssembly.dll
Sean
source share