Boas Enkler Boas Enkler - 1 year ago 189
TypeScript Question

Disable automatic Typescript compile in asp core vs 2015

I created a new empty asp core project. I added a simple ts file.

Now per default it is automatically compiled to javascript.

Before asp core there is a option in the projects dialogs. but there are no project dialogs in the current core solution.

I Also tried what is described in this post.
So I added

to the firest property group of the xproj file but it doesn't change anything.

Sometime ago I installed the typescript complete package maybe its related to this?

Any advice on how to stop visual studio to autocmpile typescript files in a core application?

xProj now looks like this

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="">
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

<!-- Makes the TypeScript compilation task a no-op -->

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">

<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>

<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />

Answer Source

Edit your tsconfig.json and set compileOnSave to false.

   "compileOnSave": false,
   "compilerOptions": {
       "noImplicitAny" : true
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download