The command "call $(ProjectDir)some_console_application.exe" exited with code 1

31 Views Asked by At

I get this error when trying to publish my website The command call c:\..\..\some_console_application.exe exited with code 1

When i use this command call c:\..\..\some_console_application.exe from the CMD it works great, but it keeps failing when using it on VS publish command

FolderProfile.pubxml or project.csproj

<Project>
    ...
    <Target Name="BeforeBuild">
        <Exec Command="call $(ProjectDir)prebuild.exe" />
    </Target>
</Project>

I tried some commands but no luck:

1. <Exec Command="$(ProjectDir)prebuild.exe" />

1

There are 1 best solutions below

0
taekyeon On

ok,.. I found the answer... sometimes answers only comes after you share others with your loads...

the error is caused by the "Exit code", if you use a console application you should add the line Environment.exitCode=0; or just add the attribute IgnoreExitCode="true"

<Project>
    ......
    <Target Name="BeforeBuild">
        <Exec Command="$(ProjectDir)prebuild.exe" IgnoreExitCode="true" />
    </Target>
</Project>