Generated code has many missing assemblies

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
flycast
Posts: 19
Joined: Mon 04 Feb 2019 19:39

Generated code has many missing assemblies

Post by flycast » Mon 04 Feb 2019 21:58

Learning Entity developer with SQLite for an embedded application. Getting closer. My database validates in Entity Developer. When I create code I get a lot of errors. My generated code is throwing errors on the following using statements. These statements are also showing as unused:

Code: Select all

using System.Data.EntityClient;
using System.Data.Metadata.Edm;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
And the error(s) looks like this:
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'EntityClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) Entity Designer Test C:\Users\erics\source\repos\Entity Designer Test\Entity Designer Test\DataModel1.Designer.cs 21 Active
I *do* have System.Data in my references.

If I delete the using statements that are the issue and add:

Code: Select all

using System.Data.Entity.Core.Objects;
using System.Data.Entity.Core.EntityClient;
those issues go away. Is this just simply editing templates to remove/add the proper using refereences or is there something deeper I am missing?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Generated code has many missing assemblies

Post by Shalex » Tue 05 Feb 2019 18:09

Please right click *.edml in Solution Explorer > Open With > Entity Developer, press OK. Double click the designer surface to open Model Settings and make sure that the "Entity Framework version" is set to "Entity Framework 6". This should help.

JIC: navigate to Tools > Entity Developer > Model Explorer, open the Templates node. You can disable/remove a predefined EntityObject template and enable the DbContext template. Refer to https://blog.devart.com/entity-develope ... plate.html

flycast
Posts: 19
Joined: Mon 04 Feb 2019 19:39

Re: Generated code has many missing assemblies

Post by flycast » Sun 10 Feb 2019 03:54

That looks like it resolved the issue. Thank you.

flycast
Posts: 19
Joined: Mon 04 Feb 2019 19:39

Re: Generated code has many missing assemblies

Post by flycast » Sun 10 Feb 2019 20:58

I do get the following warning now...
1 Model validation for Entity Framework 6 is not supported: the 'EntityFramework.dll' assembly is not available or .NET Framework 4.5 is not installed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Generated code has many missing assemblies

Post by Shalex » Mon 11 Feb 2019 11:12

Refer to viewtopic.php?f=30&t=32670. In case of a standalone Entity Developer, you should download EntityFramework.dll via Tools Nuget Package Manager > Package Manager Console and copy this assembly to the Entity Developer installation folder.

flycast
Posts: 19
Joined: Mon 04 Feb 2019 19:39

Re: Generated code has many missing assemblies

Post by flycast » Mon 11 Feb 2019 15:56

Thank you for that. Much easier to use in Visual Studio!

Post Reply