简体   繁体   中英

visual studio post build event run exe with arguments

I have c# command line application that I need to run right after it's compiled so for this purpose we have Post-build event command line in visual studio. I am trying to run it and provide command line arguments but it always fails and exits with code 3. Not sure what there reason. This is how I am running it

$(OutDir)PRG.CommandsGenerator.exe -cs $(SolutionDir)TTP\Commands.xml $(SolutionDir)TTP\NAPI.Generated.cs $(SolutionDir)Data\

where PRG.CommandsGenerator.exe name of my executable

-cs -command line option

$(SolutionDir)TTP\\Commands.xml - file in src direcroty in TTP folder that has to be passed as argument

$(SolutionDir)TTP_NAPI.Generated.cs - file in src direcroty in TTP folder that has to be passed as argument

$(SolutionDir)Data\\ - folder in src directory that has to be passed as argument

Am I doing anything wrong ?

Embedded space in any paths? Try enclosing all path arguments in double quotes. Also try echoing out your command to view/verify in the VS build output window. You may also copy it from there and paste to the command line to validate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM