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` should call `dotnet restore` if project.json has changed

See original GitHub issue

Today, dotnet build (and thus dotnet run) is separate from dotnet restore. I’d like to discuss having dotnet build (and thus dotnet run) detect if project.json has been modified since the last compilation, then perform a dotnet restore if project.json has been modified.

Two motivations:

  1. It’s easy to forget to dotnet restore after you add a NuGet package, etc.
  2. It would benefit VSCode, described in Issue dotnet/sdk#5312.

If this has already been proposed and closed, I couldn’t find the issue. What’s the rationale for them being separate?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
enricosadacommented, Jul 29, 2016

pls dont add too much magic, not everything has the same workflow.

maybe i need to run dotnet restore -f /path/to/my/packages or other command line args, instead of plain dotnet restore.

restore it’s a separate step from build. that’s it, is not too bad And the build is already too entangled to nuget (the restore), and is a pain to configure/extend

2reactions
livarcocccommented, Apr 17, 2017

We are adding no-op restore for CLI 2.0.

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 >
dotnet restore getting error with new csproj file, no project. ...
I am starting to develop an ASP.NET Core MVC Web application with yeoman generated project and ran dotnet restore . It gives me...
Read more >
NuGet Restore build issues - project.assets.json doesn't ...
Manually Run NuGet.exe restore, or dotnet.exe restore in a commandline. Pls let me know if the error still exists after trying any of...
Read more >
R.I.P project.json - Out with the new, in with the old
An early look at the new csproj project format which replaces project.json in Visual Studio 2017 for .NET Core projects.
Read more >
Part 2 - Caveats of project.json to MSBuild conversion
The new .NET Core SDK is fundamentally re-architected. If you primarily use “dotnet restore” and “dotnet build”, you may not notice this at ......
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