Generated code not included in VS2019 project

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
[email protected]
Posts: 10
Joined: Wed 29 Jun 2016 13:34

Generated code not included in VS2019 project

Post by [email protected] » Wed 16 Dec 2020 17:34

I upgraded to dotConnect for PostgreSQL Ver. 7.20.1782 and Entity Developer Ver. 6.10.1135. VS2019 Community is Version 16.8.3. My project targets .NET Framework 4.6.2.

Using Entity Developer standalone, the code generation doesn't update the VS2019 project. For example, I can add a class to the model, save the model and run code generation. The C# code file is generated properly, but the VS2019 project doesn't change to include the new code file. If I then delete the class, save the model, and run code generation, the C# file is properly deleted.

If I use VS2019 integrated Entity Developer, everything seems to work fine. I really like using the standalone application, though. I've used it for years and its worked fine until now.

I am using a user template based on DbContext.

How can I get the standalone code generation to update the VS2019 project again?

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

Re: Generated code not included in VS2019 project

Post by Shalex » Fri 18 Dec 2020 14:33

This question is about VS2019 functionality: you should choose "Add as link" instead of "Add" via the Add > Existing Item menu of Visual Studio.

Refer to https://stackoverflow.com/questions/198 ... pying-them.

[email protected]
Posts: 10
Joined: Wed 29 Jun 2016 13:34

Re: Generated code not included in VS2019 project

Post by [email protected] » Fri 18 Dec 2020 19:29

This doesn't work. I added the .edml to my VS2019 projectas a link, then added a new class to the model (using standalone ED) and ran the code generation. A DbSet<TestClass> gets added to the DbContext, but same as before, the new class TestClass.cs does not get added to the VS2019 project file (so it doesn't appear in the Solution Explorer).

Whatever magic the integrated ED does to insert the new .cs file into the VS project file isn't being done by the standalone ED.

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

Re: Generated code not included in VS2019 project

Post by Shalex » Wed 23 Dec 2020 17:23

[email protected] wrote: Fri 18 Dec 2020 19:29I added the .edml to my VS2019 projectas a link,
You should "Add as link" the generated code files instead of the *.edml model.

Post Reply