Bug in template/designer interaction in Visual Studio 2013

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
billster6809
Posts: 30
Joined: Mon 27 Jan 2014 21:08

Bug in template/designer interaction in Visual Studio 2013

Post by billster6809 » Mon 07 Jul 2014 15:37

System:
Visual Studio 2013.2
Entity Developer 5.7.387

Steps to reproduce bug:
0. Open solution in Visual Studio 2013 which has a model with DbContext template
1. Open the EDML designer
2. Open the associated DbContext template, which has been copied to model for editing
3. In the GenerateRelationProperty() method, add a reference to a non-existent property, example:
var badProperty = relationProperty.GetProperty("BadProperty");
4. Save the template and ask ED to generate. Get the expected error that BadProperty is unknown.

5. Switch back to the designer. In ModelSettings, Extended Properties, for Property, add BadProperty. I added it as a boolean.
6. Save the designer, which will cause the template to be executed.

Errors:
1. You will still get the error that BadProperty is unknown.

2. At this point, the template has become 'disconnected' from the model. Editing the template so that it can force a code generation again will always say BadProperty is unknown.

3. If I close the template and reopen it, same problem. Also, in some cases, I *cannot* reopen it. Visual Studio gets into a state where neither a double-click on the template or context menu "Open" will open the template. Closing and re-opening the solution does not help when it gets in this state. I must completely shut down Visual Studio to recover.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Bug in template/designer interaction in Visual Studio 2013

Post by MariiaI » Tue 08 Jul 2014 12:29

Please perform one of the following steps:
1) Open Model Settings-> Extended Properties-> RelationProperty and add a new extended property "BadProperty". Save the changes and regenerate the code.
or
2) Open the DbContext template and add the following entry at the 55 line in the DbContext configuration section:

Code: Select all

<#@ extended name="BadProperty" owner="RelationProperty" default="true" type="System.Boolean" #>
Save the changes and regenerate the code.

Please notify us about the results.

billster6809
Posts: 30
Joined: Mon 27 Jan 2014 21:08

Re: Bug in template/designer interaction in Visual Studio 2013

Post by billster6809 » Tue 08 Jul 2014 15:23

That is what I did before. I just repeated to confirm I get this error.
1. Edited GenerateRelationProperty and added:
var test2 = relationProperty.GetProperty("BadProperty2");
2. Saved template, save model. Get not found for BadProperty2
3. Edit model, add extended property, type RelationProperty, name BadProperty2
4. Save model. Still get BadProperty2 not found.
5. Close template, reopen, add a space so can save again.
6. Save template, save model. Still not found.

Not found will not go away until model is closed, reopened.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Bug in template/designer interaction in Visual Studio 2013

Post by MariiaI » Wed 09 Jul 2014 10:42

Thank you for the response. We have managed to reproduce the issue. We will investigate it and inform you about the results as soon as possible.

billster6809
Posts: 30
Joined: Mon 27 Jan 2014 21:08

Re: Bug in template/designer interaction in Visual Studio 2013

Post by billster6809 » Wed 09 Jul 2014 13:56

Thank you. Certainly not a big issue, easy to work around. Just wanted you to know.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Bug in template/designer interaction in Visual Studio 2013

Post by MariiaI » Fri 01 Aug 2014 05:31

The bug with applying changes after editing the list of the extended properties via the Model Settings dialog is fixed.
New build of Entity Developer 5.7.412 is available for download!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).

For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=30069.

billster6809
Posts: 30
Joined: Mon 27 Jan 2014 21:08

Re: Bug in template/designer interaction in Visual Studio 2013

Post by billster6809 » Wed 06 Aug 2014 03:38

Thank you!

Post Reply