include typescript file in output result build with TFS

532 views Asked by At

I want to have ts files in output result. when tfs build my project all ts file will compiled but just js files copy to drop folder or output. I need ts files in published web sites, but I could not copy them with TFS Build. I have seen this link How to include TypeScript files when publishing? but It dose not work for me. When I add each ts files as a content in csproject, that files copy to bin folder as a result. but it's hard to do for all type script files and I tjink it isn't good approch.

1

There are 1 answers

0
AFatehi On

So after many work, I found the problem Actually this link work correctly:How to include TypeScript files when publishing? but in my csproject there is a strange thing, we have multi import tag and I found the order of theme must be as the following:

 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
 <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\$(MSBuildToolsVersion)\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

In the other hands the Microsoft.CSharp.targets import tag MUST be the first to include type script files as content worked correctly.