禁用ASP Core VS 2015中的自动TypeScript编译

3
我创建了一个新的空的asp core项目。我添加了一个简单的ts文件。
现在默认情况下它会自动编译成javascript。
在asp core之前,项目对话框中有一个选项。但是在当前的核心解决方案中没有项目对话框。
我还尝试了post中描述的方法。 所以我在xproj文件的第一个属性组中添加了<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>,但这并没有改变任何东西。
一段时间前,我安装了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>
1个回答

6

3
除了手动配置外,具有内置TypeScript支持的项目类型在项目设置页面上还有一个TypeScript Build选项卡,可以在其中切换“保存时编译”选项。 - John Weisz
1
但不是核心项目类型。我要求的是什么 ;) - Boas Enkler
在VS2017的项目设置页面中切换“保存时编译”选项对我没有任何作用。这个方法解决了问题! - Alex

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接