inside
inside

Reputation: 3177

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 ?

Upvotes: 1

Views: 6266

Answers (1)

Scott Jones
Scott Jones

Reputation: 2906

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.

Upvotes: 1

Related Questions