【发布时间】:2021-10-01 18:23:00
【问题描述】:
我正在使用 Visual Studio 2022 Preview 和 .NET 6 SDK。
在这里,我正在创建一个有 2 层的 webAPI 项目。 api 项目 (Bgvsystem.webAPI) 类库(BgvSystem.Persistance)
NuGet 包-
安装包 Microsoft.EntityFrameworkCore.SqlServer -Version 6.0.0-rc.1.21452.10
安装包 Microsoft.EntityFrameworkCore.Tools -Version 6.0.0-rc.1.21452.10
安装包 Microsoft.VisualStudio.Web.CodeGeneration.Design -版本 6.0.0-rc.1.21464.1
当我尝试使用脚手架添加控制器时,出现以下错误
There was an error running the selected code generator: unable to resolve service for type 'microsoft.entityframeworkcore.dbcontextoption.. While attempting to activate Dbcontext in .net 6 and visual studio 2022 preview
如何解决这个问题?请帮忙。
【问题讨论】:
-
我这里有同样的问题..会试试这个stackoverflow.com/questions/70516934/…
标签: asp.net-core-webapi .net-6.0 visual-studio-2022 entity-framework-6.4