无法使用aspnet-codegenerator生成脚手架,下面是我尝试过的:
使用创建了一个 ASP.Net RazorPages 应用程序
dotnet new webapp
做了一个
dotnet build
使用安装 dotnet-aspnet-codegenerator
dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4
冉
dotnet aspnet-codegenerator --help
它说:此项目中没有可用的代码生成器。将Microsoft.VisualStudio.Web.CodeGeneration.Design包作为 NuGet 包引用添加到项目中。
使用添加了步骤 4 中提到的包
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
添加的包是:
<ItemGroup> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" /> </ItemGroup>
又跑了:
dotnet build
最后一步
冉
dotnet aspnet-codegenerator --help
它再次表示:此项目中没有可用的代码生成器。将 Microsoft.VisualStudio.Web.CodeGeneration.Design 包作为 NuGet 包引用添加到项目中。
.Net核心安装版本:3.1.401
操作系统:Ubuntu 20.04