project-system: UpToDateCheck: always fail if projects.assets.json is updated
Visual Studio Version: 16.5.5
Summary:
Steps to Reproduce:
-
Create .NET Standard project
-
Build twice (UpToDateCheck should work on second build)
-
Touch
obj\projects.assets.json
(in practice, it happens to me once in a while when VS restore solution) -
Build once: UpToDateCheck fails (expected) and trigger build However output files are not being touched because
CoreCompile
is skipped (Inputs
don’t containobj\projects.assets.json
, only.cs
files)
Expected Behavior:
- Build again: UpToDateCheck succeed
Actual Behavior:
- Build again: UpToDateCheck fails (because output files are still older than
obj\projects.assets.json
)
User Impact:
UpToDateCheck is broken until a full Rebuild
Workaround
Here’s a MSBuild Target to add this file to CoreCompile
inputs:
<Target Name="_GenerateCompileInputsProjectAssets" AfterTargets="_GenerateCompileInputs">
<ItemGroup>
<CustomAdditionalCompileInputs Include="$(ProjectAssetsFile)" />
</ItemGroup>
</Target>
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Remove AdditionalDependentFileTimes from fast up-to-date check At some point in the history of the fast up-to-date check we used AdditionalDependentFileTimes data to track files such as .editorconfig... — committed to drewnoakes/project-system by drewnoakes 3 years ago
- Remove AdditionalDependentFileTimes from fast up-to-date check At some point in the history of the fast up-to-date check we used AdditionalDependentFileTimes data to track files such as .editorconfig... — committed to drewnoakes/project-system by drewnoakes 3 years ago
@nkolev92 sorry that I didn’t answer at the time. I don’t remember exactly when the problem started.