Error scaffolding Identity Fails the second time after using CLI code generator

ThunderBox 0 Reputation points

Hi I ran the code generator once to scaffold the login and register pages. Then I ran it again because I needed to scaffold the password page but it wouldn’t build and I got errors. I am using vs studio for Mac and the cli commands to scaffold pages.
Any help Is appreciated.

Here is the code I ran the first time: dotnet aspnet-codegenerator identity -dc TimeClock.Data.ApplicationDbContext --files "Account.Register;Account.Login”

Here is the code I ran the second time: dotnet aspnet-codegenerator identity -dc TimeClock.Data.ApplicationDbContext --files "Account.ForgotPassword"

Error I get

...error CS0433: The type 'SignInManager' exists in both 'Microsoft.AspNetCore.Identity, Version=, Culture=neutral, PublicKeyToken=some# and 'Microsoft.AspNetCore.Identity, Version=, Culture=neutral...

A set of technologies in the .NET Framework for building web applications and XML web services.
3,756 questions
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,191 questions
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
309 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 28,206 Reputation points Microsoft Vendor

    Hi @ThunderBox

    Whether your application is an 7 or core 2 application? From the error message, it seems that your project having two different versions of the same assembly, to resolve this error, use the alias feature of the (References) compiler option or do not reference one of your assemblies.

    Then, clean and rebuild your application.

    More detail information, see Compiler Error CS0433.

    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,


    0 comments No comments