Visual Studio 2015 / Windows 10 SDK SignTool.exe error?

I have a project that I am upgrading to Visual Studio 2015, but it still targets .NET 4.5.1.

Whenever $ (WindowsSDKBinPath) is installed in the Windows 10 SDK "C: \ Program Files (x86) \ Windows Kits \ 10 \ bin \ x86 \", signtool.exe exits with exit code 255, and the output is disabled, as follows:

The following certificate was selected:
    Issued to: XXXX
    Issued by: VeriSign Class 3 Code Signing 2010 CA
    Expires:   Tue Apr 11 19:59:59 2017
    SHA1 hash: XXXX

Done Adding Additional Store

Usually an error appears here if there is an error, but what is it, it turns off right here and exits with exit code 255.

If $ (WindowsSDKBinPath) is installed in the Windows 8.1 SDK "C: \ Program Files (x86) \ Windows Kits \ 8.1 \ bin \ x86 \", then everything is fine. SignTool.exe signs the DLL without any problems and exits with code 0, as usual.

Can someone help me understand how to use the new pointer, or at least know why it doesn't work? Below is the goal that I added to my csproj file to get it to sign after the build. Thanks.

<Target Name="AuthenticodeProjectSign" AfterTargets="AfterBuild">
  <PropertyGroup>
    <AuthenticodeTimestampServerUrl>http://timestamp.verisign.com/scripts/timstamp.dll</AuthenticodeTimestampServerUrl>
    <TargetAssembly>$(OutDir)$(TargetFileName)</TargetAssembly>
  </PropertyGroup>

  <Exec Command="&quot;$(WindowsSDKBinPath)signtool.exe&quot; sign /v /sha1 $(AuthenticodeCertificateSHA1) /t $(AuthenticodeTimestampServerUrl) &quot;$(TargetAssembly)&quot;" />
</Target>
+4
source share
1 answer

signtool @my Machine and it works on the builds server. On VisualStudio 2015 and Windows 10 Enterprise 64bit, I had to add ClickOnce publishing tools to VisualStudio Setup: Install Visual Studio 2015, where you can add ClickOnce

After that, you will find the signtool.exe file in

  • c: \ Program Files (x86) \ Windows Kits \ 8.1 \ bin \ x64 \
  • c: \ Program Files (x86) \ Windows Kits \ 8.1 \ bin \ x86 \
  • c:\Program Files (x86)\Windows Kits\8.1\bin\ \
+2

Source: https://habr.com/ru/post/1612092/


All Articles