`dotnet build` should call `dotnet restore` if project.json has changed
See original GitHub issueToday, 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:
- It’s easy to forget to
dotnet restore
after you add a NuGet package, etc. - 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:
- Created 8 years ago
- Reactions:5
- Comments:12 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 plaindotnet restore
.restore
it’s a separate step frombuild
. that’s it, is not too bad And thebuild
is already too entangled to nuget (therestore
), and is a pain to configure/extendWe are adding no-op restore for CLI 2.0.