visual studio mac for mac missing of identity class

Viewed 5290

Hi i downloaded visual studio for mac 2017 community version. I created a default MVC Core 2.0 project and i noticed that there is missing class of Account controllers where it used to have register and account other handler functions.

i created the same project in windows .In windows i can see that there is identity class and controller created.

how do i generate this authentication class in visual studio for mac Core 2.0?

I tried creating the default project in windows and copy to mac and it works!!! After i change the connection string to the server.Identity framework works fine in mac. But why is microsoft not generating the code for mac?

3 Answers

Currently the GUI for Mac Visual Studio does not support the ability to add Authentication. However, the CLI does!

  1. dotnet new sln --name <filename>

    • This will create a new sln
    • If you don't use the --name flag the sln will take the current folder's name
  2. dotnet new mvc -o moviemvc --auth Individual

    • This will create a new .csproj with mvc and Authentication (Identity models) included
  3. dotnet sln add </filepath>

    • This will add the file to the sln in the folder (if exists)
  4. dotnet sln <path-to-solution.sln> add <path-to-project.csproj>

    • If you have multiple sln's in the folder, you will have to specify the sln you want to target

You can find more information here too

Related