Projects using the new project system and alpha SDK are always rebuilt rather than allowing the solution to be incrementally built. Steps to reproduce:
1) Check out https://github.com/gulbanana/repro-netcore-incrementality
2) Build the solution once. Result is
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
3) Build a second time. Result is
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
The second result should have been 0 succeeded, 2 up-to-date. The projects are still internally incremental, so they aren't slow rebuilds, but this means that if you have a .net core project at the root of a dependency hierarchy then entire solutions are constantly rebuilt, and you can't use features (like unit testing coverage) which rely on re-executing the same binary repeatedly.
Thanks for the feedback. This is known and being tracked by: https://github.com/dotnet/roslyn-project-system/issues/62.
We basically don't have a "fast up-to-date" check that skips MSBuild. We'll add one before we ship.
Hmm, are downstream projects being rebuilt? That shouldn't happen due to _their_ up-to-date checks.
They are! Doesn't seem to matter whether the downstream ones are Core or old.
I can repro this, the first build after a build doesn't suffer from this:
1>------ Build started: Project: ClassLibrary20, Configuration: Debug Any CPU ------
1>ClassLibrary20 -> C:\Users\davkean\Documents\Visual Studio 2017\Projects\ClassLibrary20\ClassLibrary20\bin\Debug\net45\ClassLibrary20.dll
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
It's expected that .NET Core projects calls MSBuild until we've implemented: https://github.com/dotnet/roslyn-project-system/issues/62.
However, second build after that does:
1>------ Rebuild All started: Project: ClassLibrary20, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: ClassLibrary1, Configuration: Debug Any CPU ------
1>ClassLibrary20 -> C:\Users\davkean\Documents\Visual Studio 2017\Projects\ClassLibrary20\ClassLibrary20\bin\Debug\net45\ClassLibrary20.dll
2> ClassLibrary1 -> C:\Users\davkean\Documents\Visual Studio 2017\Projects\ClassLibrary20\ClassLibrary1\bin\Debug\ClassLibrary1.dll
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
I suspect this is caused by: https://github.com/dotnet/sdk/issues/708
Going to dup this against dotnet/sdk#708.
Just to clarify, the rebuilding of downstream projects due to .NET Core projects building is caused by dotnet/sdk#708.
The "building" of .NET Core projects will be resolved when we implement #62.
Turns out this requires a project-system fix, so reopening this.
Most helpful comment
Thanks for the feedback. This is known and being tracked by: https://github.com/dotnet/roslyn-project-system/issues/62.
We basically don't have a "fast up-to-date" check that skips MSBuild. We'll add one before we ship.