project-system: UpToDateCheck: always fail if projects.assets.json is updated

Visual Studio Version: 16.5.5

Summary:

Steps to Reproduce:

  1. Create .NET Standard project

  2. Build twice (UpToDateCheck should work on second build)

  3. Touch obj\projects.assets.json (in practice, it happens to me once in a while when VS restore solution)

  4. Build once: UpToDateCheck fails (expected) and trigger build However output files are not being touched because CoreCompile is skipped (Inputs don’t contain obj\projects.assets.json, only .cs files)

Expected Behavior:

  1. Build again: UpToDateCheck succeed

Actual Behavior:

  1. 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

Most upvoted comments

@nkolev92 sorry that I didn’t answer at the time. I don’t remember exactly when the problem started.