无法使用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
asp.net-core-mvc .net-core asp.net-core razor-pages asp.net-core-razor-pages
我发现包:Microsoft.VisualStudio.CodeGeneration 在 nuget 中有超过 20,000,000 次下载。但我找不到任何文档。
如何使用它?
有没有关于它的文章?