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 :


http://msdn.microsoft.com/en-us/library/ms180786%28VS.80%29.aspx


** 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 http://codesigning.ksoftware.net/export 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 : http://blogs.msdn.com/b/andrekl/archive/2008/01/08/strong-name-signing-in-visual-studio-2005-requires-keyspec-2-at-signature.aspx