Oblomov
Oblomov

Reputation: 9665

exit code 9009 executing command from within ms build

I want to include a webpack build step in a test.csproj, to "build" some javascript code.

The javascript code lives at "D:\js_code". When I enter

D:\js_code>webpack

in the command line, everything works fine and the expected results are produced.

To include the command in the test.csproj, I used

 <Target Name="Build">
    <PropertyGroup>
         ... 
    </PropertyGroup>
    <Exec Command     ... />
    <Exec Command="D:\js_code\webpack.exe"/>
  </Target>

Where ... are placeholders for other tags and commands that are totally valid and produce correct results and were therefore left out here.

When I build test.csproj, I get

The command "D:\js_code\webpack.exe" exited with code 9009

same with just

<Exec Command="D:\js_code\webpack"/>

What could be the problem?

Upvotes: 0

Views: 911

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100761

  1. Try running webpack.exe from the command line as well to check for any errors. Alternatively, run msbuild /v:diag > diag.log to get a diagnostic log that will show webpack's output as well.

  2. Webpack will need to run in the directory the js code is in, sou you probably need

    <Exec Command="webpack.exe" WorkingDirectory="D:\js_code" />
    

Upvotes: 1

Related Questions