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.

Slow incremental builds with .NET Core 2.0

See original GitHub issue

Steps to reproduce

  1. Build a solution
  2. Build it again

Expected behavior

Building a project again should be fast if no files were changed. For example this happens in Visual Studio:

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
1>------ Build started: Project: ScoreAnalyzer.Tests, Configuration: Debug Any CPU ------
1>ScoreAnalyzer.Tests -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.Tests\bin\Debug\netcoreapp2.0\ScoreAnalyzer.Tests.dll
========== Build: 1 succeeded, 0 failed, 8 up-to-date, 0 skipped ==========

Actual behavior

Rebuilding takes the same time as the first build.

C:\Users\Adam\Downloads\ScoreAnalyzer>dotnet build
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  ScoreAnalyzer.DTOs -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.DTOs\bin\Debug\netstandard2.0\ScoreAnalyzer.DTOs.dll
  Helpers -> C:\Users\Adam\Downloads\ScoreAnalyzer\Helpers\bin\Debug\netstandard2.0\Helpers.dll
  Utilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\Utilities\bin\Debug\netstandard2.0\Utilities.dll
  ScoreAnalyzer.AWS -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.AWS\bin\Debug\netstandard2.0\ScoreAnalyzer.AWS.dll
  MusicRepresentations -> C:\Users\Adam\Downloads\ScoreAnalyzer\MusicRepresentations\bin\Debug\netstandard2.0\MusicRepresentations.dll
  ScoreAnalyzer.TestUtilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.TestUtilities\bin\Debug\netstandard2.0\ScoreAnalyzer.TestUtilities.dll
  Evaluation -> C:\Users\Adam\Downloads\ScoreAnalyzer\Evaluation\bin\Debug\netstandard2.0\Evaluation.dll
  ScoreAnalyzer -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer\bin\Debug\netstandard2.0\ScoreAnalyzer.dll
  ScoreAnalyzer.Tests -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.Tests\bin\Debug\netcoreapp2.0\ScoreAnalyzer.Tests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:12.22

C:\Users\Adam\Downloads\ScoreAnalyzer>dotnet build
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  ScoreAnalyzer.DTOs -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.DTOs\bin\Debug\netstandard2.0\ScoreAnalyzer.DTOs.dll
  Helpers -> C:\Users\Adam\Downloads\ScoreAnalyzer\Helpers\bin\Debug\netstandard2.0\Helpers.dll
  ScoreAnalyzer.AWS -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.AWS\bin\Debug\netstandard2.0\ScoreAnalyzer.AWS.dll
  Utilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\Utilities\bin\Debug\netstandard2.0\Utilities.dll
  MusicRepresentations -> C:\Users\Adam\Downloads\ScoreAnalyzer\MusicRepresentations\bin\Debug\netstandard2.0\MusicRepresentations.dll
  ScoreAnalyzer.TestUtilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.TestUtilities\bin\Debug\netstandard2.0\ScoreAnalyzer.TestUtilities.dll
  Evaluation -> C:\Users\Adam\Downloads\ScoreAnalyzer\Evaluation\bin\Debug\netstandard2.0\Evaluation.dll
  ScoreAnalyzer -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer\bin\Debug\netstandard2.0\ScoreAnalyzer.dll
  ScoreAnalyzer.Tests -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.Tests\bin\Debug\netcoreapp2.0\ScoreAnalyzer.Tests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.57

C:\Users\Adam\Downloads\ScoreAnalyzer>dotnet build --no-restore
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  ScoreAnalyzer.DTOs -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.DTOs\bin\Debug\netstandard2.0\ScoreAnalyzer.DTOs.dll
  Helpers -> C:\Users\Adam\Downloads\ScoreAnalyzer\Helpers\bin\Debug\netstandard2.0\Helpers.dll
  ScoreAnalyzer.AWS -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.AWS\bin\Debug\netstandard2.0\ScoreAnalyzer.AWS.dll
  Utilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\Utilities\bin\Debug\netstandard2.0\Utilities.dll
  ScoreAnalyzer.TestUtilities -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.TestUtilities\bin\Debug\netstandard2.0\ScoreAnalyzer.TestUtilities.dll
  MusicRepresentations -> C:\Users\Adam\Downloads\ScoreAnalyzer\MusicRepresentations\bin\Debug\netstandard2.0\MusicRepresentations.dll
  Evaluation -> C:\Users\Adam\Downloads\ScoreAnalyzer\Evaluation\bin\Debug\netstandard2.0\Evaluation.dll
  ScoreAnalyzer -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer\bin\Debug\netstandard2.0\ScoreAnalyzer.dll
  ScoreAnalyzer.Tests -> C:\Users\Adam\Downloads\ScoreAnalyzer\ScoreAnalyzer.Tests\bin\Debug\netcoreapp2.0\ScoreAnalyzer.Tests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.36

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:13
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nguerreracommented, Aug 15, 2018

@zuckerthoben Sorry to hear that. Can you open a new issue so that we can iterate on that with you? Please start by sharing the output of dotnet build /clp:PerformanceSummary.

1reaction
axotcommented, Sep 22, 2017

Has same problem in OS X.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow incremental builds with .NET Core 2.0 · Issue #8690
Steps to reproduce Build a solution Build it again Expected behavior Building a project again should be fast if no files were changed....
Read more >
Incremental ASP.NET to ASP.NET Core Migration
A simple pattern to apply the Strangler Fig pattern to migrating ASP.NET to ASP.NET Core applications with the help of some new adapters....
Read more >
Source generator updates: incremental ...
In this post I look at the updates to the source generator API in .NET 6, why the changes were made, and how...
Read more >
Improving compilation times of a monolithic .NET assembly
Incremental builds may help you with your single monolithic DLL. In 2.0 they were introduced but it was mainly focused on detecting ...
Read more >
Improve Visual Studio Build Performance
With Build Acceleration you can reduce incremental build times for SDK-style .NET projects by up to 80%.”. If build performance is a concern...
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