Visual Studio 2017を使用していて、ビルド後のコマンドを追加したいとします。私が「マクロス」ウィンドウに行くと、$(ProjectDir)変数に適切なパスが入っていることがわかります。だから私は、コマンドを追加しました:
$(ProjectDir)ClientApp\npm run build
が、私は、ビルドを実行すると、私は次のエラーを取得する:
The command 'ClientApp\npm run build'exited with code 3.
私はMSBuildのを変更するには、診断するための冗長で出力]ウィンドウに私が見た:
を1>Target "PostBuildEvent" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets": 1> Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". 1> Task "Exec" 1> Task Parameter:WorkingDirectory=bin\Debug\netcoreapp1.1\ 1> Task Parameter:Command=ClientApp\npm run build 1> ClientApp\npm run build 1> The system cannot find the path specified. 1>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4933,5): error MSB3073: The command "ClientApp\npm run build" exited with code 3. 1> Done executing task "Exec" -- FAILED.
ターゲットファイルには次の行があります。
<Target
Name="PostBuildEvent"
Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
DependsOnTargets="$(PostBuildEventDependsOn)">
<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
</Target>
作業ディレクトリを$(OutDir)から$(ProjectDir)に変更できますか?
私が間違っているアイデアはありますか? NB - 私は、BATファイルにコマンドを追加しただけでテストすることが、結果は$(MSBuildProjectDirectory)を試してみてください同じ
が、これは私の作品^^ –
疑問は、なぜ$(PROJECTDIRですありがとう)は空ですか? – MistyK