Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scaffold identity files in Visual Studio 2019 for mac?

I have included AspNetCore.Identity in my MVC web app project however, the model and view files do not scaffold automatically. In Visual Studio for Windows the option to scaffold identity is in the context menu via 'Add > New Scaffolded Item'. Is there a similar scaffolding option in Visual Studio 2019 for Mac?

I have found info on how to scaffold identity files using terminal here however, my question is about if Visual Studio for Mac has this ability in the UI.

like image 964
stalemate Avatar asked Oct 15 '22 00:10

stalemate


1 Answers

There are few solutions:

(1) trick: Use Visual Studio on Windows, then scaffolding. Then copy to macOS computer. It's easy way.

(2) On macOS computer, Install tool

dotnet tool install -g dotnet-aspnet-codegenerator

then generate scaffoloding files

dotnet aspnet-codegenerator identity -h

Reference document: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-an-empty-project

like image 160
Do Nhu Vy Avatar answered Oct 21 '22 11:10

Do Nhu Vy