Core 3:未找到名称为'identity'的代码生成器

问题描述 投票:0回答:1

dotnet --info

.NET Core SDK (reflecting any global.json):

Version:   3.0.100

Commit:    04339c3a26 
Runtime Environment:

OS Name:     Mac OS X

OS Version:  10.15

OS Platform: Darwin

RID:         osx.10.15-x64

Base Path:   /usr/local/share/dotnet/sdk/3.0.100/ 
Host (useful for support):

Version: 3.0.0

Commit:  7d57652f33 
.NET Core SDKs installed:

3.0.100 [/usr/local/share/dotnet/sdk] 
.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

我创建了一个新的ASP.Net Core MVC Web应用程序并添加了软件包:

dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design

dotnet add package Microsoft.EntityFrameworkCore

dotnet add package Microsoft.EntityFrameworkCore.SqlServer

dotnet add package Microsoft.EntityFrameworkCore.Design

dotnet add package Microsoft.AspNetCore.Identity

我尝试运行命令:

dotnet aspnet-codegenerator identity -h

我得到:

Selected Code Generator: identity
No code generator found with the name 'identity'.

自更新SDK和运行时以来,为什么“身份”不是有效的代码生成器?

asp.net-identity asp.net-core-3.0 asp.net-mvc-scaffolding
1个回答
0
投票

通过使用dotnet add package命令行,它将在.csproj文件中生成以下参考:

<ItemGroup>
   <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
   <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
   <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
   </PackageReference>
   <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
   <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
</ItemGroup>

将版本更改为3.0.0,如下所示:

<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
© www.soinside.com 2019 - 2024. All rights reserved.