The error means there is a mismatch of library versions. The libraries you posted are very old and no longer supported. You should move to a supported version of .NET like .NET 8.
Cannot locate Microsoft.VisualStudio.Web.CodeGeneration.Design
Just installed "ASP.net and web development" - and started with the tutorial "RazorPagesMovie" - step 2. On adding "New Scaffolded Item" I get "Error - There was an error running the selected code generator: 'Package restore failed. Rolling Back package changes for "RazorPagesMovie" Beating on the internet I found
- https://stackoverflow.com/questions/65285501/error-when-trying-to-add-a-scaffolded-item-in-razor-pages
- https://github.com/dotnet/Scaffolding/issues/1540
- https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/intro?view=aspnetcore-5.0&tabs=visual-studio
Basically I believe have to install a variety of packages
Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.9"
Include="Microsoft.VisualStudio.Web.CodeGeneration.Core" Version="3.1.
going into Project / Manages NuGet Packages - I do not see them - where do I find these packages and how do I install them (if they are already installed - it creates an even bigger problem)
2 answers
Sort by: Most helpful
-
-
SurferOnWww 2,661 Reputation points
2024-03-08T01:14:17.38+00:00 Basically I believe have to install a variety of packages
No, you do not have to install any NuGet packages manually. If you did it, probably the issue is caused by the mismatch of NuGet versions as AgaveJoe mentioned in his answer.
I understand that you followed the following Microsoft tutorial. Please note that the tutorial does not instruct to add any NuGet packages.
Tutorial: Create a Razor Pages web app with ASP.NET Core
If you exactly follow the instruction in the tutorial, the required NuGet packages will be automatically installed in the project at the step of "Scaffold the movie model" in the Part 2.
I suggest you uninstall all the NuGet packages and then try "Scaffold the movie model" in the Part 2 again.