dotnet / Scaffolding

Code generators to speed up development.
MIT License
643 stars 230 forks source link

.NET 6 scaffolder timing bug with Microsoft.VisualStudio.Web.CodeGeneration.Design #1710

Open Rick-Anderson opened 3 years ago

Rick-Anderson commented 3 years ago

Currently when you scaffold anything you get an error that you need to install Microsoft.VisualStudio.Web.CodeGeneration.Design.

The scaffolder should add that. It adds other packages.

To repo:

UPDATE: @guardrex noticed that invoking the scaffolder does add

<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />

So running it the 2nd time works. So it looks like a timing issue.

guardrex commented 2 years ago

I even had a Blazor Server app this morning where the timing was good. There was no error about the package. Scaffolding took me from the New Scaffolded Item dialog directly to the Add Identity dialog. When I tried this afternoon to repro this morning's good behavior, a new Blazor Server app 💥 with the error ... but added the package ... a second scaffold attempt then succeeded (without my manually doing anything else).

wenz commented 2 years ago

Can repro with scaffolding Identity (which has additional issues). The modal error message appears. Upon closing it, you are back to the "Add new Scaffolded item" wizard. Clicking on Add again works then. I'd concur that this is a timing issue. @deepchoudhery is already taking a look AFAIK.