【问题标题】:How can I change the check of Visual Studio if a project needs to be built如果需要构建项目,如何更改 Visual Studio 的检查
【发布时间】:2018-05-28 19:54:28
【问题描述】:

我正在创建一个基于 .net 核心控制台应用程序的项目模板。它由打字稿文件组成(当更改时)需要触发项目的重新编译。这应该是后续添加某些“.ts”文件时的默认设置。

当对 .cs 文件进行更改时,Visual Studio 会根据自己的假设而不是 msbuild 知道何时需要重新编译。可以通过将以下部分添加到 csproj 文件来关闭此一般行为:

<PropertyGroup>
    <DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

我也从这里 (How to avoid that Visual Studio incremental build does not run when files outside <Compile> and <EmbeddedResource> are changed?) 了解到我可以添加

<UpToDateCheckInput Include="file.dat" />

为该 Visual Studio 检查包含一个文件。我的问题是:

我怎样才能对某种类型的所有文件执行此操作,比如说“*.ts”?

我还可以将文件的默认构建操作指定为嵌入资源或使用模板添加到项目后的任何内容吗?

【问题讨论】:

    标签: visual-studio project recompile


    【解决方案1】:

    我怎样才能对某种类型的所有文件执行此操作,比如“.ts”?*

    &lt;UpToDateCheckInput Include="**\*.dat" /&gt;

    还有我可以将文件的默认构建操作指定为嵌入资源或使用我的模板添加到项目中的任何内容吗?

    Default build action for a filetype

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 2019-05-27
      • 1970-01-01
      • 2010-12-05
      • 2013-09-30
      • 2011-08-18
      • 2016-05-18
      相关资源
      最近更新 更多