Click here to Skip to main content
14,843,450 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have the script for post build event.
copy /y "$(SolutionDir)Libs\MotionDetect.dll" "$(SolutionDir)$(ConfigurationName)"
call editbin.exe /LARGEADDRESSAWARE SER.EXE > recpost.txt
call dumpbin.exe /HEADERS SER.EXE > recpost1.txt


I don't know what is wrong.

But I get
exited with code 1


What I have tried:

maybe add quote but not sure if to add quote around "editbin.exe"
Posted
Updated 15-Jan-20 1:51am
Comments
Richard MacCutchan 7-Sep-17 11:50am
   
The log from the build event should be in one of the project directories, and also shown in the output window during the build.

Probably one of the executed commands returns with a non-zero code.

Unfortunately there is no documentation for the return codes of the VS tools but you can check them using the VS console or by printing them out in the build step:
copy /y "$(SolutionDir)Libs\MotionDetect.dll" "$(SolutionDir)$(ConfigurationName)"
echo %ERRORLEVEL%
call editbin.exe /LARGEADDRESSAWARE SER.EXE > recpost.txt
echo %ERRORLEVEL%
call dumpbin.exe /HEADERS SER.EXE > recpost1.txt
echo %ERRORLEVEL%
If you want to ignore errors, just reset the errorlevel after the command:
SET ERRORLEVEL=0
   
I had a similar issue.
My solution was to add a
MKDIR "$(SolutionDir)$(ConfigurationName)"

before the copy.
   
v2
1. All codes smaller 8 are successcodes
2. Code 1 means "Successfully copied"
3. for some reason my visual studio alway threw "Code 1" as an exception which is bullshit
4. i had to fix it by simply adding the following line in the end:
exit 0

Hope i could help.
@Microsoft... if you read this... why though?! why use successcodes if you just treat 'em as errors?!
   
Comments
Richard MacCutchan 15-Jan-20 8:16am
   
This is not correct, an exit code of 1 is produced when a copy fails. When it succeeds the exit code is 0.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900