_This issue has a corresponding ticket on Developer Community. Please vote and comment there to make sure your voice is heard._
[regression] [worked-in:16.5.4]
Issue: when using the 16.6.0 Preview 5.0 version of Visual studio Professional, we are facing an issue that Visual studio builds projects that have not changed. This leads to very long builds on bigger solutions.
Note: the same solution builds ok using the 16.5.4 version of Visual studio.
The behavior can be reproduced using the following steps:
So far โ all good.
Now:
This wrong behavior will magically disappear if you modify the .csproj file (eg. add a space, delete a space). After a first build, the subsequent builds again correctly indicate that the project is up-to-date.
(while this can be a workaround on small projects, on bigger solutions, it is impractical to modify all the .csproj files to avoid the issue)
Additional info: running on Windows 10 (1909). No 3rd party anti-virus. Tried both with Windows Defender real time protection turned off an on โ no difference.
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. Weโll keep you posted on any updates to this feedback.
(no solutions)
1>FastUpToDate: Adding UpToDateCheckBuilt outputs: (ConsoleApp7)
1>FastUpToDate: 'C:\Users\oscalles\source\repos\ConsoleApp7\ConsoleApp7\bin\Debug\net5.0\ConsoleApp7.dll' (ConsoleApp7)
1>FastUpToDate: 'C:\Users\oscalles\source\repos\ConsoleApp7\ConsoleApp7\obj\Debug\net5.0\ConsoleApp7.pdb' (ConsoleApp7)
1>FastUpToDate: 'C:\Users\oscalles\source\repos\ConsoleApp7\ConsoleApp7\obj\Debug\net5.0\ConsoleApp7.dll' (ConsoleApp7)
1>FastUpToDate: 'C:\Users\oscalles\source\repos\ConsoleApp7\ConsoleApp7\bin\Debug\net5.0\ConsoleApp7.pdb' (ConsoleApp7)
1>FastUpToDate: The set of AdditionalDependentFileTimes was changed more recently (5/14/2020 1:55:17 PM) than the earliest output 'C:\Users\oscalles\source\repos\ConsoleApp7\ConsoleApp7\bin\Debug\net5.0\ConsoleApp7.dll' (5/14/2020 1:51:55 PM), not up to date. (ConsoleApp7)
Can we change the log say which files within AdditionalDependentFilesTimes changed?
Is there any workaround for VS 16.6 before 16.7 release?
@ipanin not a great one. If you rebuild, the up-to-date check will get back into a good state.
A workaround that works for my solution with 85 projects:
Thank you @Jinjinov your steps worked for me. ๐
- MOST IMPORTANT: never close Visual Studio, or the problem will reappear
So FWIW I did indeed run into this problem again after closing the solution. But was then able to work around this by:
Not sure if I was lucky, but I will monitor in case I close it again. For instance, I am not sure (re-)closing the solution (step 1) is necessary.
In my case, I closed it forgetting of this issue/condition and tried the above. This is going to take an adjustment. :P
Rebuild will get things back into a good state (see https://github.com/dotnet/project-system/issues/6181#issuecomment-633201307).
Yeah I did try that the first time I encountered this issue @drewnoakes but it didn't work for whatever reason. Now it seems to be working well. Or at least, for a workaround. :)
OK, I see the source of my confusion now. Rebuild does get everything back into a good state, but there is a subsequent build required to do so. In my case, at least. So:
When I previously attempted to use Rebuild, I tried building again (step 2) and it didn't seem to be working, so gave up. The trick was to build it a 2nd time (step 3) to get everything working as expected.
Woohoo... I can confirm this is fixed in 16.7.0. ๐ Thank you for all your diligent work over there, team! Visual Studio is starting to feel really solid these days.
Also a shout of appreciation for dealing with those of us who are continuously learning patience and get a little grumpy when things don't fall according to perfect expectations. ๐๐
Nothing has been fixed in 16.7.0 and 16.7.1. So random rebuilds continue with each click on the "build".
========= Build: 1 succeeded, 0 failed, 71 up-to-date, 2 skipped ==========
========== Build: 21 succeeded, 0 failed, 51 up-to-date, 2 skipped ==========
========== Build: 1 succeeded, 0 failed, 71 up-to-date, 2 skipped ==========
========== Build: 7 succeeded, 0 failed, 65 up-to-date, 2 skipped ==========
@NektoDron Please turn on verbose logs via the following and file a new bug:
