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.

dotnet publish is slow

See original GitHub issue

Steps to reproduce

Create a small console app and add some NuGet packages. Run dotnet publish to publish app

Expected behavior

The publish step should perform roughly similar to a robocopy operation on newer files

Actual behavior

Dotnet publish is considerably slower

Environment data

dotnet --info output:

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

turowiczcommented, Apr 8, 2019

A lot of people now use Docker, where the publish is only meant to package the app.

The following takes really long time:

RUN dotnet publish src/${project}/${project}.csproj -c Release -o /app/out/ --no-restore --no-build
InfinitiesLoopcommented, Aug 9, 2020

I am also experiencing this. I use docker to build, then publish a console application. The publish call takes ~10 seconds on my dev windows machine, but it takes >30 MINUTES on a micro VM. During that time the machine is practically idle. It gets stuck in between two projects, as if one particular project is the culprit (which is not the same one as publish was called on). I totally expect terrible performance on a micro VM, but this is not just performance, it’s something gone terribly wrong…

Read more comments on GitHub >

github_iconTop Results From Across the Web

aspnet core build slow only when publishing
Publish can take a long time if your App generates temp files and you don't remove these files regularly. Try to check 'Remove...
Read more >
DotNet core slow restore : r/docker
DotNet core slow restore. Hello,. recently I'm facing a increase on the build time (+5 minutes from initial ~1 minute) when doing ....
Read more >
Speed of dotnet run vs the speed of dotnet for published ...
On my machine, dotnet run is 2.7s, but dotnet tst.dll is 0.04s. .NET Core is fast. Dotnet publish --self-contained. I could then publish...
Read more >
Dotnet task build much slower than VS build task
Can you help figuring out why is it so slow using dotnet task with sdk project while it was very fast (almost like...
Read more >
Speeding up some very slow .NET builds - Yaakov's Blog
Very strangely, the .csproj builds at the start of the build were taking the expected amount of time, but the ones at the...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found