首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MVC5.0中的脚手架标识错误(没有ASP.NET的WebApp)

MVC5.0中的脚手架标识错误(没有ASP.NET的WebApp)
EN

Stack Overflow用户
提问于 2020-12-01 03:05:13
回答 1查看 450关注 0票数 0

我想要获取身份的源页,并在documentation中执行所有操作。我在dotnet aspnet-codegenerator identity -h中停止了,因为它抛出了错误:

代码语言:javascript
复制
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。项目文件:

代码语言:javascript
复制
<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>

我没有解决这个问题的想法。

EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65079641

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档