程序包还原失败。回滚软件包更改VS2019

时间:2020-08-24 12:16:52

标签: asp.net api c#-4.0 visual-studio-2019 core

 scaffolding was not worked 程序包还原失败。回滚VS2019中针对asp.net核心的软件包更改。 何时,我尝试使用EF添加API控制器。 这对我没用 -尝试清除所有Nuget缓存, -尝试清除ComponentModelCache Can't Add View from Controller in VS 2015 : "There was an error running the selected code generator" 它不能解决此错误。

有人可以帮助我吗?

2 个答案:

答案 0 :(得分:1)

对于 EF Core 包版本 5.0.5,我只能使用命令行工具解决这个问题。在这里johanjuulj

查看Visual Studio error: There was an error running the selected code generator的回答
dotnet aspnet-codegenerator controller -m MyModel -dc MyDbContext -name MyModelssController -async

答案 1 :(得分:0)

在更新所有已安装的软件包之前,使用VS2019在.net 5.0 MVC中为IActionResult添加视图时,我遇到了同样的问题。

对我来说,重新启动Visual Studio即可。

重新启动后,我再次尝试,自动脚手架安装了此软件包“ Microsoft.VisualStudio.Web.CodeGeneration.Design”,并生成了一个视图。