devenv总是重建我的项目,因为打字稿文件比pdb文件新 [英] devenv always rebuilds my project, because a typescript file is newer than a pdb file

查看:84
本文介绍了devenv总是重建我的项目,因为打字稿文件比pdb文件新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带打字稿的项目. devenv不断重建这个项目.诊断输出包含以下行:

I have a project with typescripts. devenv constantly rebuilding this project. Diagnostics output contains this line:

Project 'Benefits' is not up to date. Input file 'C:\abc\UI\BenefitsWeb\Scripts\Benefits\Modules\PPACA\ApprovalScreen.ts' is modified after output file 'C:\abc\UI\BenefitsWeb\bin\Dayforce.Web.Benefits.pdb'.

那么,如何解决此问题?前面提到的打字稿文件确实比PDB更新.但是PDB并不是打字稿编译的输出!

So, how do I resolve this issue? The aforementioned typescript file is truly newer than the PDB. But the PDB is not the output of the typescript compilation !!!

这是我编译打字稿文件的方式:

Here is how I compile my typescript files:

<PropertyGroup>
  <CompileDependsOn>
    $(CompileDependsOn);
    CompileTypeScript
  </CompileDependsOn>
</PropertyGroup>

<Target Name="GetInputs">
  ...
</Target>

<Target Name="GetOutputs">
  ...
</Target>

<Target Name="CompileTypeScript" DependsOnTargets="GetInputs;GetOutputs" Inputs="@(InputTypeScripts)" Outputs="@(OutputJavaScripts)">
  ...
</Target>

项目在TypeScriptCompile项目组中指定打字稿文件,例如:

The project specifies the typescript files in the TypeScriptCompile item group, for instance:

<TypeScriptCompile Include="Scripts\Benefits\Modules\PPACA\CalendarSetup.ts" />

当然,@(OutputJavaScripts)仅列出了预期的.js文件.那里没有PDB文件.

Of course, @(OutputJavaScripts) lists the expected .js files only. No PDB files there.

那么devenv如何将打字稿文件与PDB文件进行匹配?我该如何解决?

So how come devenv matches a typescript file with a PDB file? How do I fix it?

编辑1

我想澄清一下.它实际上并没有重新编译打字稿或C#文件(这是第一次,它确实重新编译了打字稿文件,但仅限于此).因为typescript比PDB更新,所以它开始构建,但是随后它发现实际上没有更改PDB依赖关系. javascript文件也是如此-它们都是最新的.因此,实际上什么都没有重建,但是为什么要首先输入构建顺序!

I would like to clarify. It does not actually recompile the typescript or C# files (well for the first time it does recompile the typescript files, but only that). It starts the build, because typescript is newer than a PDB, but then it recognizes that no PDB dependency has actually changed. The same is true for the javascript files - they are all up-to-date. So nothing is actually rebuilt, but why to enter the build sequence in the first place!

推荐答案

我对js文件有类似的问题.将其Build Action设置为无",重新编译,然后返回到Content,重新编译即可解决此问题.

I had a similar issue with a js file. Setting its Build Action to None, recompile, then back to Content, recompile solved the issue.

这篇关于devenv总是重建我的项目,因为打字稿文件比pdb文件新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆