question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UpToDateCheck: always fail if projects.assets.json is updated

See original GitHub issue

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>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
xen2commented, Aug 14, 2020

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

0reactions
drewnoakescommented, Dec 15, 2021

I just tried the repro steps here and it no longer reproduces in 17.1. We have made several changes to the fast up-to-date check since this issue was filed, and looking at the code I do not expect this issue to exist any more. I expect the fix exists in 16.11 (possibly earlier).

I’ll close this. Let me know if you still experience this issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assets file project.assets.json not found. Run a NuGet ...
The error occurs because the dotnet cli does not create the all of the required files initially. Doing dotnet restore adds the required...
Read more >
NuGet Restore build issues - project.assets.json doesn't ...
If you run restore using dontet or msbuild, and then check if the project. asset. json is regenerated. It should be different from...
Read more >
NETSDK1004: Assets file not found - .NET CLI
This error occurs when the assets file project.assets.json is not found during build. The full error message is similar to the following ...
Read more >
Fixing missing project.json error in old csproj format
The cause comes from left over files in your obj catalogues. The file in question seems to named project.assets.json. Deleting these in all...
Read more >
project.assets.json not found when building on teamcity agent
When we run using the TeamCity agent, we always get the following error: C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found