Visual Studio pre-build event; Checking exit code for each event -


i have solution multiple projects. 1 project needs build if both 2 events, in pre-build event, exit error code 0.

so thought following:

"c:\path\to\binary1.exe" & "c:\path\to\binary2.exe"

in test scenario goes wrong binary1.exe exits non-zero value. visual studio goes on building project anyway. when run pre-build event commandline in cmd , echo %errorlevel% see exit code being non-zero.

when put

"c:\path\to\binary1.exe"

in pre-build event, build stopped , en error shown in error list window of visual studio.

i sure binary1.exe exiting non-zero value shows messagebox prior exit.

i can think of 1 solution. binary1.exe calling binary2.exe , exiting non-zero exit code when binary2.exe exits non-zero exit code. not flexible solution.

to summarize: how can run multiple pre-build events , stop buidling when 1 of commands returns non-zero value?

i think yuou can follows:

run command 1 if errorlevel 1 (     exit /b 1     ) run command 2 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -