Search code examples
asp.net-coreasp.net-core-mvcvisual-studio-mac

Trying to get user authentication when creating a project in Visual Studio ASP.NET Mac


I'm watching tutorials on how to implement user authentication in my MVC project and they all select "User Authentication" when creating the project. This is not an option on Visual Studio 2019 Mac for some reason and I don't know how to create this authentication without the template.

Is there anything I can do?


Solution

  • Well... For some reason, Visual Studio for Mac does not have the option to create a project with Individual authentication. Don't ask me why, Microsoft is weird like that sometimes. However, you can use the CLI to create the project. That has the option for all the Identity class. Use the command

    dotnet new mvc -o ProjectName --auth Individual
    

    Add

    -uld
    

    in the auth option to use local db instead of SQLite. Check out this link for more information. dotnet new command on MSDN
    Hope this helps...