3

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 <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> 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="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>

1 Answer 1

6

Edit your tsconfig.json and set compileOnSave to false.

http://www.typescriptlang.org/docs/handbook/tsconfig-json.html

{
   "compileOnSave": false,
   "compilerOptions": {
       "noImplicitAny" : true
   }
}
Sign up to request clarification or add additional context in comments.

3 Comments

In addition to manual configuration, project types with built-in TypeScript support have a TypeScript Build tab on the project settings page, where the Compile on save option can be toggled.
but not in in the core project type. what is i asked for ;)
Toggling the Compile on save did nothing for me in the project settings page in VS2017. This solved it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.