我想要获取身份的源页,并在documentation中执行所有操作。我在dotnet aspnet-codegenerator identity -h中停止了,因为它抛出了错误:
Usage: aspnet-codegenerator [arguments] [options]
Arguments:
generator Name of the generator. Check available generators below.
Options:
-p|--project Path to .csproj file in the project.
-n|--nuget-package-dir
-c|--configuration Configuration for the project (Possible values: Debug/ Release)
-tfm|--target-framework Target Framework to use. (Short folder name of the tfm. eg. net46)
-b|--build-base-path
--no-build
Selected Code Generator: identity
No code generator found with the name 'identity'.
No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.
RunTime 00:00:01.29我在Arch Linux中有一个.NET 5.0。Microsoft.VisualStudio.Web.CodeGeneration.Design和其他软件包安装为5.0.0。项目文件:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>USER-SECRETS-ID-CENSORED</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SendGrid" Version="9.21.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\img" />
</ItemGroup>我没有解决这个问题的想法。
发布于 2021-04-06 06:46:57
如果当前版本不正确,请尝试卸载该版本:
dotnet tool uninstall --global dotnet-aspnet-codegenerator
您必须使用以下命令安装dotnet代码生成器的5.0版本:
dotnet tool install --global dotnet-aspnet-codegenerator --version 5.0.2
并键入以下命令以显示所有隐藏文件:
dotnet aspnet-codegenerator identity
https://stackoverflow.com/questions/65079641
复制相似问题