aspnet-codegenerator:即使添加了Microsoft.VisualStudio.Web.CodeGeneration.Design,也没有可用的代码生成器

问题描述

我无法尝试使用 aspnet-codegenerator 生成脚手架:

  1. 使用以下命令创建一个ASP.Net RazorPages应用程序 dotnet new webapp

  2. 有一个dotnet build

  3. 使用

    安装的dotnet-aspnet-codegenerator

    dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4

  4. dotnet aspnet-codegenerator --help

    它表示:该项目中没有代码生成器。将 Microsoft.VisualStudio.Web.CodeGeneration.Design 软件包作为NuGet软件包引用添加到项目中。

  5. 使用步骤

    添加了第4步中提到的程序包

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

    添加的包裹为:

    <ItemGroup> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" /> </ItemGroup>

  6. 再次运行:dotnet build

    最后一步

  7. dotnet aspnet-codegenerator --help

    再次说:该项目中没有代码生成器。将Microsoft.VisualStudio.Web.CodeGeneration.Design软件包作为NuGet软件包引用添加到项目中。

.Net核心安装版本:3.1.401

操作系统:Ubuntu 20.04

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)