ErikEJ / EntityFramework6PowerTools

This is the codebase for Entity Framework 6 Power Tools Community Edition, and modern EF 6 providers for SQL Server and SQL Server Compact
Other
183 stars 27 forks source link

Unable to find expected assembly attribute [DesignTimeProviderServices] in provider assembly 'ErikEJ.EntityFramework.SqlServerCompact' #125

Closed GianlucaGrotto closed 1 year ago

GianlucaGrotto commented 1 year ago

Dear Erik, I have installed this package 'ErikEJ.EntityFramework.SqlServerCompact' in my VS2022 C# project in .NET6. I tryed to generate the ef model with this command:

Scaffold-DbContext -Connection "Data Source= C:\temp\TestModelEFCore\TestModelEFCore\dbsqlcompact\gsdata.sdf;" -Provider ErikEJ.EntityFramework.SqlServerCompact -OutputDir dbsqlcompact/Entities -ContextDir DatabaseModel -Context MyContext -UseDatabaseNames -f -Verbose

what I've received is the message above. what can I do is it possible to generate the model?

thank you very much Gianluca

ErikEJ commented 1 year ago

ScaffoldDbContext is for EF Core, and this provider is for EF 6 Classic. You should be able to use the EF6 Entity Data Model tooling to create a model from the database, but it is not something I have tried/tested.

ErikEJ commented 1 year ago

You might need to add a .NET Framework project to your solution to do this.

GianlucaGrotto commented 1 year ago

so I could create a model with .net framework and then port it on .net6, isnt't it?

ErikEJ commented 1 year ago

Yeah, it is a little complex, I think you can create a model with the "EntityFramwork.SqlServerCompact" package in a .NET Framework project, and then copy/share the generated files. Use "Code First from Database". You may also have to install SQLite Toolbox to get the DDEX provider (SQL Server Compact Simple by ErikEJ)

GianlucaGrotto commented 1 year ago

Thank you very much for your kind support!

ErikEJ commented 1 year ago

@GianlucaGrotto You are very welcome. Not many users of SQL Server Compact now.

If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship

GianlucaGrotto commented 1 year ago

sure

ErikEJ commented 1 year ago

Just updated the package btw, it was broken

GianlucaGrotto commented 1 year ago

ok thks