ASP.NET Web Core with .NET Core 7.0 Error While Generating Scaffolding

Hochgurtel, Brian D 20 Reputation points
2023-10-03T16:04:46.3866667+00:00

In an ASP.NET core project built on .NET Core 7.0 I am trying to scaffold the login page with the following steps:

  • I right click on the project, and select Add -> New Scaffolded Item
  • I select Identity and Click on Add
  • Then I choose Account/Login Then I get the following Error:

User's image

I see this posted in several forums, but none of the suggested solutions work for me. Any help is appreciated!

Brian

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-10-04T02:47:44.83+00:00

    Hi @Hochgurtel, Brian D,

    Can you tell us which version of code generator you are using? And can you tell us your Visual Studio version?

    From the error message, it seems that there was an issue with the package restoration process while working with the code generator.

    You can try to refer to the following steps to troubleshoot and potentially resolve the problem.

    1. Check your Internet connection, make sure you can download/install the package.
    2. Clean and rebuild the project.
    3. Close and reopen the Visual Studio and reopen the project.
    4. Use NuGet Package Manager to check the installed packages, make sure you are installed the Microsoft.VisualStudio.Web.CodeGeneration.Design 7.0.9 version. You can also try to in-install this package.
    5. Try to clear the local package cache. You can use the dotnet nuget locals all --clear command.

    Besides, I'm using Visual Studio Community 2022 (64-bit) Version 17.6.0 and 7.0.9 version code generator. The Scaffolding works well.

    User's image

    Besides, I also checked it using Visual Studio Community 2022 (64-bit) Version 17.7.4 and 7.0.9 version code generator, it also works well:

    User's image

    So, I suggest you can try to use the Microsoft.VisualStudio.Web.CodeGeneration.Design 7.0.9 version and upgrade the VS 2022 to the latest version.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Dillion

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.