There are several methods of signing with Visual Studio, depending on exactly what you want to do.

For signing the compiled EXE, a post-build step is the easiest route :

In order to get a signature automatically applied to your EXE (or DLL) when you compile/build, you need to call a signing utility like SignTool.exe as a post-build step.

Microsoft has a good tutorial on that, view it here :

** Note that you could use the kSign command line tool instead of signtool.exe 

If you want strong name signing (at the assembly level), you'll need to re-import your certificate. Follow the procedure to export it to a file from and then re-import the certificate in to the CSP with the command:

certutil importPFX -user AT_SIGNATURE

This sets the KeySpec=2 flag (AT_SIGNATURE).

You can then re-export THAT certificate and use it directly with Visual Studio.

Source :