visual studio mac for mac missing of identity class

后端 未结 3 783
借酒劲吻你
借酒劲吻你 2020-12-30 14:52

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

相关标签:
3条回答
  • 2020-12-30 15:22

    ok this is the command to include authentication for mac ok visual studio 2017 core 2.0.

     dotnet new mvc -o moviemvc --auth Individual
    

    once u register a new account. it will create a new database in the folder with app.db which is filebase database i believe. open db use this sql lite browser to open it and view the content of it.

    if you want to use sql server instead then you will need to add this into the line when create new project with terminal. add it in front of --auth will do

    -uld
    
    0 讨论(0)
  • 2020-12-30 15:38

    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

    0 讨论(0)
  • 2020-12-30 15:41

    With Visual Studio on Windows there are extra options you can configure when creating a new ASP.NET Core project. These extra configuration options are not currently available with Visual Studio for Mac so a simpler ASP.NET Core project is created.

    So you are left with copying the project from Windows, as you already did, or you can open a command prompt and use dotnet new to create a project. If you run the following you can see what configuration options you can specify for the ASP.NET Core MVC project template:

     dotnet new mvc --help
    
    0 讨论(0)
提交回复
热议问题