如何在 Visual Studio 2019 for mac 中搭建身份文件?

sta*_*ate 5 asp.net-identity asp.net-core-mvc visual-studio-mac

我已经在我的 MVC Web 应用程序项目中包含了 AspNetCore.Identity,但是模型和视图文件不会自动构建脚手架。在 Visual Studio for Windows 中,脚手架标识的选项位于上下文菜单中,通过“添加 > 新建脚手架项”。Visual Studio 2019 for Mac 中是否有类似的脚手架选项?

我已经找到了如何使用终端脚手架身份文件的信息在这里不过,我的问题是关于如果Visual Studio for Mac可以具有在UI这种能力。

nhu*_*uvy 3

解决办法有以下几种:

(1)窍门:在Windows上使用Visual Studio,然后搭脚手架。然后复制到 macOS 计算机。这很简单。

(2)在macOS计算机上,安装工具

dotnet tool install -g dotnet-aspnet-codegenerator
Run Code Online (Sandbox Code Playgroud)

然后生成脚手架文件

dotnet aspnet-codegenerator identity -h
Run Code Online (Sandbox Code Playgroud)

参考文档:https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity ?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-an-empty-项目