Atif Husain

Atif Husain

  • NA
  • 9
  • 2.4k

.NET 6.0 - Scaffolding Identity - Length cannot be less than zero err

Aug 15 2022 5:57 PM

Hi, 

I am new and using Visual Studio for mac 2022. I am developing a react js ASP .NET application and wants to use the Identity of ASP.NET. 

I am trying to add custom fields to a user registration in react js application to do that I am trying to create scaffold for identity using the below (as per multiple online articles). 

dotnet aspnet-codegenerator identity -dc ApplicationDbContext --files "Account.Register;Account.Login;Account.Logout"

however I am getting the below error when run on terminal. not able to find much help on internet. 

--------------------------------------------------------------------

Building project ...

Finding the generator 'identity'...

Running the generator 'identity'...

Length cannot be less than zero. (Parameter 'length')

   at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()

   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)

   at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)

   at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)


Answers (2)