I create a new wpf .net framework project. I connect ADO data models to it.
Select database objects to include
Database diagram is created fine
But data model classes are not defined
What could be the problem, I'm using Visual Studio 2022 version 17.6.1?
I tried reinstalling visual studio but that didn't help.
There are two solution:
(1).Turn your visual studio version back to 17.5.x.
(2)OpenC:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude
change line 1920:
_generationEnvironment = type.GetProperty("GenerationEnvironment", BindingFlags.Instance | BindingFlags.NonPublic);
to
_generationEnvironment = type.GetProperty("GenerationEnvironment");
this issue has been fixed in https://github.com/dotnet/ef6tools/commit/89cd126 by Adam Ratzman.