vs2012 fails to add ts files to compile command

Topics: General
Oct 22, 2012 at 8:03 AM

I have a project, in which typescript does not want to compile anymore. 
When I look at the build output, I can see, the tsc.exe is executed without any files to compile.

The exec command seems ok to me:

<Exec Command="&quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\\tsc&quot; @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" />
Compiler output is like this:
1>Task "Exec"
1>  "C:\Program Files (x86)\Microsoft SDKs\TypeScript\\tsc" 
1>  Syntax:   tsc [options] [file ..]
1>  Examples: tsc hello.ts
1>            tsc --out foo.js foo.ts
1>            tsc @args.txt
 As you can see, there is no list of ts files. I even tried to recreate the project and adding al files again, with same result..

Oct 22, 2012 at 3:31 PM

The exec command looks right.  Looking at mine, it should also be in the BeforeBuild ("<Target Name="BeforeBuild">").  Did you create your own project or use the default VS project for TypeScript?

Oct 22, 2012 at 5:58 PM
Edited Oct 22, 2012 at 6:32 PM

I found the problem, for some reason the following was missing from the csproj file :


    <TypeScriptCompile Include="$(ProjectDir)\**\*.ts"/>

The project was made using the default VS project for TypeScript... 
I inserted the ItemGroup and now everything compiles fine. No idea why it was removed.

Update: it seems all items where added as Content.. (after I added the above, all ts files where added twice to the project), like this:

 <Content Include="app.ts" />