Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After spending much time experimenting and searching, found an <a href="http://geekswithblogs.net/SoftwareDoneRight/archive/2010/05/27/fix-visual-studio-post-build-event-returns-ndash1-when-it.aspx" rel="noreferrer">article</a>, mentioned <a href="http://blog.robertromito.com/2010/08/ignore-error-from-visual-studio-post.html" rel="noreferrer">here</a> in a comment. It looks like Visual Studio scans the output, searching for some special keywords. Signtool.exe outputs among the other <code>EXEC : SignTool error : An error occurred</code>, which seems like enough to alert Visual Studio that there was an error. </p> <p>So, the solution proposed was to redirect output and error streams to nul as <code>2&gt;nul 1&gt;nul</code>. Errorlevel will still be set, so you will be able to figure out if error occured. But you may have to print some extra messages to see the status:</p> <pre><code>REM try to timestamp the file... signtool.exe timestamp /t %timestamp_server% %1 2&gt;nul 1&gt;nul if errorlevel 0 if not errorlevel 1 ( echo Successfully timestamped: %1 GOTO succeeded ) echo Timestamping failed for %1 </code></pre> <p>Now Visual Studio is happy:</p> <blockquote> <pre><code>1&gt;------ Build started: Project: myproject, Configuration: NonOptimized x64 ------ 1&gt; Done Adding Additional Store 1&gt; Successfully signed: E:\tfs\MySolution\bin\x64\NonOptimized\myproject.dll 1&gt; 1&gt; Timestamping failed for "E:\tfs\MySolution\bin\x64\NonOptimized\myproject.dll" 1&gt; Successfully timestamped: "E:\tfs\MySolution\bin\x64\NonOptimized\myproject.dll" 1&gt; signfile.bat exit code is 0. ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== </code></pre> </blockquote> <p>In fact, just adding <code>2&gt;nul</code> would be enough to fix it. Error stream will still be printed: <code>Number of errors: 1</code>, but it does not cause a problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload