Share via

SqlServerCompact EFCore Model Generation

Gianluca Grotto 0 Reputation points
2023-04-05T08:59:05.0666667+00:00

I want to generate a EF Model in a project C# WindowsForm (under .NET6 ) from a SQLServerCompact file. Using Scaffold-DbContext command (see below) I receive an error:

Method ‘Create’ in type ‘EFCore.SqlCe.Scaffolding.Internal.SqlCeDatabaseModelFactory’ from assembly ‘EntityFrameworkCore.SqlServerCompact40, Version=2.2.0.0, Culture=neutral, PublicKeyToken=9af395b34ac99006’ does not have an implementation.

this is the command executed

Scaffold-DbContext -Connection “Data Source= C:\temp\TestModelEFCore\TestModelEFCore\dbsqlcompact\gsdata.sdf;” -Provider EntityFrameworkCore.SqlServerCompact40 -OutputDir dbsqlcompact/Entities -ContextDir DatabaseModel -Context MyContext -UseDatabaseNames -f -Verbose

Any suggestion? thank you Gianluca

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.