Error MSB4064 The "ComputeOutputOnly" parameter is not supported by the "VsTsc" task
다음과 같은 빌드 오류가 발생합니다.
Error MSB4064 The "ComputeOutputOnly" parameter is not supported by the "VsTsc" task. Verify the parameter exists on the task, and it is a settable public instance property.
Error MSB4063 The "VsTsc" task could not be initialized with its input parameters.
원인이 되는 파일의,
C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\build\Microsoft.TypeScript.targets
위치에 가면, ComputeOutputOnly 속성이 정의되어 있습니다.
<VsTsc
ToolPath="$(TscToolPath)"
ToolExe="$(TscToolExe)"
IsFileSystemCaseSensitive="$(IsFileSystemCaseSensitive)"
...[생략]...
GenerateDeclarationFiles="$(GenerateDeclarationFiles)"
GenerateSourceMaps="$(GenerateSourceMaps)"
ComputeOutputOnly="true">
<Output TaskParameter="GeneratedJavascript" ItemName="emittedFiles" />
</VsTsc>
이 오류를 수정하려면 아마도 ComputeOutputOnly 값을 제거해도 되겠지만, 가만 보니 .csproj 프로젝트 파일의 TypeScript 도구 버전이 2.5로 되어 있는 것을,
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Label="Globals">
<Platforms>AnyCPU;x64</Platforms>
<TypeScriptToolsVersion>2.5</TypeScriptToolsVersion>
</PropertyGroup>
...[생략]...
</Project>
문제가 안되는 다른 버전으로 바꿔도 되겠다는 생각이 들었습니다. "C:\Program Files (x86)\Microsoft SDKs\TypeScript" 폴더의 하위에 각각 2.2, 2.3, 2.5, 2.6 폴더가 있는데 이 중에서 가장 최신으로 보이는 2.6으로 올리니 정상적으로 빌드가 됩니다. 확인 결과 2.6 버전의 Microsoft.TypeScript.targets 파일에는 VsTsc 사용에 ComputOutputOnly 속성이 없습니다.
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]