2017-04-18 1 views
1

Visual Studio 2017을 사용하고 있으며 빌드 후 명령을 추가하려고합니다. '매크로'창으로 이동하면 올바른 경로가 $ (ProjectDir) 변수와 연결됩니다. 그래서 나는 명령에 추가 :

$(ProjectDir)ClientApp\npm run build

을하지만 난 다음 오류 얻을 빌드 실행할 때 : 내가 MSBuild를 변경

The command 'ClientApp\npm run build'exited with code 3.

을 상세 진단 및 출력 창에 내가 본에 :

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 파일에 명령을 추가하지만 결과는 동일

답변

4

대신

+0

왜 $ (질문은이 –

+1

^^ 나를 위해 작동 PROJECTDIR 감사 $ (MSBuildProjectDirectory)를 시도했다) 비었다? – MistyK

관련 문제