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.

"dotnet build --no-restore" restores all dependencies

See original GitHub issue

Hi,

It has been a while since I’ve seen this error, and yet it seems nobody is aware of it:

dotnet build --no-restore just restores dependencies, which is totally wrong.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
KalleOlaviNiemitalocommented, Jan 6, 2022

In which directory do you replace the DLL? Would dotnet restore copy the DLL to that directory?

0reactions
rainersigwaldcommented, Jan 7, 2022

Files are copied to the output directory as part of the build operation, not the restore operation, so I think the behavior you’re seeing is expected.

Some people accomplish your goal by modifying the file in the NuGet package store, so it’s the updated one that gets copied. If you choose to do this you should be aware that files in NuGet package store are intended to be immutable, so this will affect other projects and may require restarting processes to flush caches.

I’m going to close this as “by design” since the build seems to be doing the right thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >
Restores the dependencies and tools of a project. | dotnet- ...
The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file.
Read more >
dotnet build, exclude only one dependency from build
To disable implicit restore, use the --no-restore option. - job: steps: - task: DotNetCoreCLI@2 displayName: ...
Read more >
Help me understand restore, build, build solution : r/dotnet
Afaik, dotnet restore restores the dependencies, dotnet build then builds the code with the dependencies which were resolved by restore.
Read more >
Dotnet restore clean. cs files) Removing information from ...
The dotnet restore command uses NuGet to restore dependencies and project-specific tools specified in the project file. First off we need a ....
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