EM0
EM0

Reputation: 6337

.NET Core build rebuilding projects that have not changed

I have some C# and F# projects that were migrated from .NET Framework 4.6.1 to .NET Core 2.0. After modifying one source file and building in VS 2017 it keeps rebuilding several (sometimes all) projects every time I select "Build Solution" without further changes. I can see this from the final line of the output:

========== Build: 3 succeeded, 0 failed, 11 up-to-date, 0 skipped ==========

Building from the command line with dotnet build also take a long time, though I can't be sure that it's rebuilding, because it doesn't output a count of how many projects were rebuilt, like VS does.

How do I troubleshoot why unchanged projects are being rebuilt?

Upvotes: 2

Views: 1412

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100741

There are still a few bugs with the "up-to-date" check in visual studio, especially if there are items marked as "copy to output directory" in subfolders.

The projects aren't actually recompiled, but an MSBuild-"build" is triggered that will check for all inputs (and then do nothing). For the "up-to-date" projects, VS skips invoking MSBuild completely which makes it faster.

You can check for similar issues or report new issues for the up-to-date check at https://github.com/dotnet/project-system

Upvotes: 1

Related Questions