You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a new project (ie via dotnet new console), you currently have to run dotnet restore before running other commands such as build, run, or publish.
This issue is to make it unnecessary to explicitly run dotnet restore after creating a new project via dotnet new.
Possible ways of achieving this include implicitly running a restore operation after creating the project, or having the template include a pregenerated assets file.
The text was updated successfully, but these errors were encountered:
As long as running dotnet restore is required before building a changed project, doesn't it make sense to require it for newly created projects too, to teach users about it?
I imagine the current workflow (assuming #918 is fixed) of creating a project, building it, modifying it and then building it again goes something like this:
Run dotnet new.
Run dotnet build, get an error message explaining you need restore.
Run dotnet restore and then dotnet build.
Edit the project file and source code.
Run dotnet restore and then dotnet build, because you remember it from step 3.
With this proposed change, I think it would go like this:
Run dotnet new.
Run dotnet build successfully.
Edit the project file and source code.
Run dotnet build, get a confusing error message about missing namespace, or similar.
???
The new workflow, while it looks simpler at first, has no good place to teach users that dotnet restore is necessary, so I think it's overall worse.
The templating engine added support for PostActions recently so templates can potentially execute a restore after creation: dotnet/templating#234
Note that this needs to be decided on a per-template basis as dotnet new lib would benefit from a restore but dotnet new solution and dotnet new nugetconfig would not.
@svick This is a stepping stone. Eventually, we would like to run restore behind the scenes not only for new, but for any command that requires it. This issue is simply tracking the first turn of the crank on this.
When you create a new project (ie via
dotnet new console
), you currently have to rundotnet restore
before running other commands such asbuild
,run
, orpublish
.This issue is to make it unnecessary to explicitly run
dotnet restore
after creating a new project viadotnet new
.Possible ways of achieving this include implicitly running a restore operation after creating the project, or having the template include a pregenerated assets file.
The text was updated successfully, but these errors were encountered: