相关疑难解决方法(0)

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

asp.net-core-mvc .net-core asp.net-core razor-pages asp.net-core-razor-pages

9
推荐指数
3
解决办法
2254
查看次数

如何使用 Microsoft.VisualStudio.Web.CodeGeneration?

我发现包:Microsoft.VisualStudio.CodeGeneration 在 nuget 中有超过 20,000,000 次下载。但我找不到任何文档。

如何使用它?

有没有关于它的文章?

asp.net-core

7
推荐指数
1
解决办法
9114
查看次数