Page 1 of 1

Generated code has many missing assemblies

Posted: Mon 04 Feb 2019 21:58
by flycast
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?

Re: Generated code has many missing assemblies

Posted: Tue 05 Feb 2019 18:09
by Shalex
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

Re: Generated code has many missing assemblies

Posted: Sun 10 Feb 2019 03:54
by flycast
That looks like it resolved the issue. Thank you.

Re: Generated code has many missing assemblies

Posted: Sun 10 Feb 2019 20:58
by flycast
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.

Re: Generated code has many missing assemblies

Posted: Mon 11 Feb 2019 11:12
by Shalex
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.

Re: Generated code has many missing assemblies

Posted: Mon 11 Feb 2019 15:56
by flycast
Thank you for that. Much easier to use in Visual Studio!