Depending on your particular implementation, it is usually best to store the .snk key file in the branch you are working on.
Use case: we change the assembly signing key between versions v1.0 and v2.0. You still want to maintain the current code in the trunk, developing against the correct key in your branch.
Secondly, (and this is only best practice, not required depending on your situation - for example, how well you trust other developers) .snk file that you keep in the initial control should contain only the public key, and the solution should be configured only for a delay.
This prevents the distribution of your private key, which should be stored on the build server (most likely in the Windows key manager) and used during release builds to fully sign assemblies. If you do not have a build server, it is best to have 1 or 2 people who are entrusted with the private key, after which they can sign assemblies using sn.exe after the build. A simple shell script or batch file can automate this process.
Finally, and only if you decide to hold the sign, you need to add an entry to the .NET assembly validation list ( sn.exe -Vr *,<publicKeyToken> ) on all development workstations that will start / debug assemblies with a delayed subscription. Depending on the target platform, you must run this on both the 32-bit and 64-bit versions of the VS command line.
Hope this helps.
source share