How to sign output executable file during build process in Visual Studio?

When I use strong name key file , as indicated in the project properties, this requires that all referenced assemblies also use such a similar signature.

But I want to sign using WinDDK Signtool.exe . I already do this manually, but I also want to debug assembler assemblies, and the best way to do this is to include a signature in the assembly, possibly as an AfterBuild step.

The problem is that I do not know how to create an AfterBuild step

0
visual-studio-2010 msbuild code-signing
source share
2 answers

I had to add the following lines to the *.csproj file:

 <Target Name="AfterBuild"> <Exec Command="sign.bat" /> </Target> 

And then I added the sign.bat file to the project root folder

I found this solution in some blog

0
source share

You mix things here. A strong name is not the same as a certificate added to a binary using signtool.exe. It is also not required that dependent assemblies have a certificate or that it must comply. It also makes no sense to sign a debug build, only your client is interested in it. You already know that you can trust yourself.

Running sn.exe to create an assembly, a strong name is already supported by msbuild.

+2
source share

All Articles