I have a Visual Studio 2015 ASP.Net Core project that contains a folder of typescript files.
My question is how can I prevent VS from trying to compile the TypeScr
I spent some time digging around in the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets
file, and I found a support property that seems to do the job.
Add this property to the project, by editing the project file directly and adding this property group:
<PropertyGroup>
<!-- Makes the TypeScript compilation task a no-op -->
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
EDIT: @Chopin pointed out in the comments that the official doc for this and other Typescript MSBuild related options is here.
this trick indeed works for new version of MSBuild. However if you still have older versions of MSBUild, on a build server or so. You also want to remove these lines from the csproj file.
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
Regards