Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The target "PreComputeCompileTypeScript" does not exist in the project

I am getting this error while building the application project file:

The target "PreComputeCompileTypeScript" does not exist in the project

Can some one point me to a solution?

like image 436
Karthikeyan Anbarasan Avatar asked Mar 03 '15 05:03

Karthikeyan Anbarasan


3 Answers

Open Microsoft.TypeScript.targets file located under C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript and add the following before </Project> tag

<Target Name="PreComputeCompileTypeScript">
 <VsTsc
  ToolPath="$(TscToolPath)"
  ToolExe="$(TscToolExe)"
  Configurations="$(TypeScriptBuildConfigurations)"
  FullPathsToFiles="@(TypeScriptCompile)"
  YieldDuringToolExecution="$(TscYieldDuringToolExecution)"
  OutFile="$(TypeScriptOutFile)"
  OutDir="$(TypeScriptOutDir)"
  ProjectDir="$(ProjectDir)">      
  <Output TaskParameter="GeneratedJavascript" ItemName="GeneratedJavascript" />
  </VsTsc>
  <AssignTargetPath Files="@(GeneratedJavascript)" RootFolder="$(MSBuildProjectDirectory)">
  <Output TaskParameter="AssignedFiles" ItemName="GeneratedJavascriptWithTargetPath" />
 </AssignTargetPath>
 <ItemGroup>
  <FilesForPackagingFromProject Include="@(GeneratedJavascriptWithTargetPath->'%(Identity)')"/>
  <ContentWithTargetPath Include="@(GeneratedJavascriptWithTargetPath->'%(Identity)')"/>
  <Content Include="@(GeneratedJavascript->'%(Identity)')"/>
 </ItemGroup>
</Target>
like image 116
Rajeesh Avatar answered Nov 08 '22 14:11

Rajeesh


Do you have Visual Studio 2012 and 2013 installed on the machine? Than it might be related to this issue here: https://social.msdn.microsoft.com/Forums/en-US/cf8db2ce-4a4d-4084-93a7-ca94c9bf6ce2/visual-studio-2013-update-3-breaks-typescript-for-visual-studio-2012?forum=vssetup

The solution/work-around is described in bottom of the thread.

like image 1
Bernd Avatar answered Nov 08 '22 13:11

Bernd


just had similar issue with Visual Studio 2015, the path was like that:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.TypeScript.MDA.targets

while it's enough to insert another one dummy target:

   <!-- Overriding targets which when absent cause warnings from common targets -->
   ...
   <Target Name="PreComputeCompileTypeScript" />

</Project>

that is because target "CompileTypeScript" depends on "PreComputeCompileTypeScript".

like image 1
Martin Zeitler Avatar answered Nov 08 '22 13:11

Martin Zeitler