禁用asp core vs 2015中的自动Typescript编译

Boa*_*ler 2 typescript asp.net-core

我创建了一个新的空的asp核心项目.我添加了一个简单的ts文件.

现在默认情况下它会自动编译为javascript.

在asp核心之前,项目对话框中有一个选项.但目前的核心解决方案中没有项目对话框.

我也试过这篇文章中描述的内容.所以我添加<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>xproj文件的firest属性组,但它没有改变任何东西.

前段时间我安装了typescript完整包可能与此相关吗?

关于如何阻止visual studio在核心应用程序中自动打包typescript文件的任何建议?

xProj现在看起来像这样

<?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>
Run Code Online (Sandbox Code Playgroud)

Tse*_*eng 5

编辑你的tsconfig.json并设置compileOnSavefalse.

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

{
   "compileOnSave": false,
   "compilerOptions": {
       "noImplicitAny" : true
   }
}
Run Code Online (Sandbox Code Playgroud)

  • 除手动配置外,具有内置TypeScript支持的项目类型在项目设置页面上具有TypeScript Build选项卡,其中可以切换_Compile on save_选项. (3认同)