Dotnet aspnet -codegenerator对于dotnet core 3.1失败

时间:2019-12-17 23:58:17

标签: .net-core

我跟随https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.1&tabs=visual-studio-code并跑步

dotnet tool install --global dotnet-aspnet-codegenerator

dotnet aspnet-codegenerator razorpage -m Movie -dc RazorPagesMovieContext -udl -outDir Pages\Movies --referenceScriptLibraries

那之后,我得到了错误

Building project ...
Scaffolding failed.
Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.
To see more information, enable tracing by setting environment variable 'codegen_trace' = 1.
RunTime 00:00:03.47

我尝试使用添加程序包

dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 3.1.0

并获取错误

 Writing C:\Users\tdong.BCFSA\AppData\Local\Temp\tmpA5E0.tmp
info : Adding PackageReference for package 'Microsoft.VisualStudio.Web.CodeGeneration.Design' into 
project 'D:\Work\Testing\Movies\RazorPagesMovie\RazorPagesMovie.csproj'.
info : Restoring packages for D:\Work\Testing\Movies\RazorPagesMovie\RazorPagesMovie.csproj...
error: Package NuGet.Frameworks 4.7.0 is not compatible with netcoreapp3.1 
(.NETCoreApp,Version=v3.1). Package NuGet.Frameworks 4.7.0 does not support any target frameworks.
error: Package 'Microsoft.VisualStudio.Web.CodeGeneration.Design' is incompatible with 'all' 
frameworks in project 'D:\Work\Testing\Movies\RazorPagesMovie\RazorPagesMovie.csproj'.

0 个答案:

没有答案