我尝试将一个应用程序从.NET 4.7迁移到.NET Core 6。
我使用Net Core 6 SDK安装了Visual Studio 2022,然后创建一个类库,然后从Nugget安装EF Core。
现在,想使用“ ADO.NET实体数据模型”类似于.NET Framework 4.7的“创建模型”中的“ ADO.NET实体数据模型”创建我的类模型。
我的班级库依赖性:
datamodel创建:
,
但它给我带来了以下错误。
我还缺少什么其他依赖性?
i'm try migrate an application from .net 4.7 to .net core 6.
i installed visual studio 2022 with net core 6 sdk, then create a class library and install EF Core from nugget.
Now, want to create my class model using "ADO.NET Entity Data Model " like in .net framework 4.7 for create model from existing BD.
my class library dependences:

DataModel creation:

But it throws me the following error.


I don't understand the problem since I have .NET Core 6 installed with its sdk. What other dependency would I be missing?
发布评论
评论(2)
如果要从DB生成模型和上下文,则需要使用EF Core 脚手架使用可用工具, cli或 pmc
If you want to generate your model and context from the db you need to use ef core scaffolding using the tools available, cli or PMC
.NET 6.0不支持它
您可以将目标框架更改为.NET框架4.8
另一个选择是使用存储库模式并使用EF数据模式跳过。
我希望这会有所帮助。
It is not supported with .NET 6.0
You can change the target framework to .NET framework 4.8
Another option is to use Repository pattern and skip using EF data modal.
I hope this would help.