I started a new ASP Core project from scratch and included a basic TypeScript file.
By default, the TypeScript file is automatically compiled to JavaScript in the project.
In previous versions of ASP Core, there was an option in the project dialogs for this. However, in the current core solution, there are no project dialogs available.
I also attempted the method outlined in this post, where I added
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
to the first property group of the xproj file. Unfortunately, this did not have any effect.
I think the issue might be related to when I installed the TypeScript complete package some time ago.
Does anyone have any suggestions on how to prevent Visual Studio from automatically compiling TypeScript files in a Core application?
The xProj file now looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<!-- Makes the TypeScript compilation task a no-op -->
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>43a95da8-804b-459b-8082-fdceb957a8d2</ProjectGuid>
<RootNamespace>GulpTs</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>