Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Compile Errors in All Entity Classes after Upgrade from 2.0.1 to 2.0.5.5 #215

Closed
ab-tools opened this issue Sep 10, 2020 · 2 comments
Closed
Labels
bug Confirmed bug released Issue is resolved in a current release
Milestone

Comments

@ab-tools
Copy link

ab-tools commented Sep 10, 2020

Just updated EFDesigner in Visual Studio 2019 (16.6.0 Preview 6.0) from version 2.0.1 to 2.0.5.5 and after opening an existent model and saving it again (without any changes) all entity classes were re-generated and are completely broken now.

Basically all local variable names got removed, looking like this now:
grafik

The "Title" attribute is defined like this in the designer, can't see something special there:
grafik

And again, this happened for ALL attributes/columns (not matter which data type) in ALL entities - so not sure what to do here beside reverting back to the old version... any idea about that?

Thanks in advance
Andreas

P. S.: Talking about EF6 with .NET 4.7.2 here.

@msawczyn
Copy link
Owner

Definitely a bug. It appears that the backing field name is missing. As a preliminary diagnosis (without digging into it) it seems that there is an edge condition where, if AutoProperty = false is already set, the backing field name doesn't get generated when updating an older model. The addition of being able to change the backing field name is a new capability.

As a workaround, if you have the default for AutoProperty set to false, try changing it to true and then back to false. That should cause the default names to generate. Alternatively, if you have AutoProperty set to false on only a few properties (and it doesn't sound like that's the case), just flip them to true and back again to cause the backing field names to get set.

I'll have a fix for that in this evening.

@msawczyn msawczyn added the bug Confirmed bug label Sep 10, 2020
@msawczyn msawczyn added this to the 2.0.5.6 milestone Sep 10, 2020
@ab-tools
Copy link
Author

Much appreciating your really quick reply as always, Michael! :-)

No worries, I've switched back to version 2.0.1 for now and I'm happy to test 2.0.5.6 when you have a fix available - just let me know then.

By the way, looks like for all properties AutoProperty is set to false - was that the default somewhen in the past?
I would not know why this would be required in my case (as least I couldn't remember at the moment ;-)). Where can I define the default of that to true? Then I'll give that a try as well when you have the fix available.

@msawczyn msawczyn added the released Issue is resolved in a current release label Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

2 participants