New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFLCT_Ambiguous in release mode #6242

Closed
SamuelLioult opened this Issue Aug 4, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@SamuelLioult

SamuelLioult commented Aug 4, 2016

Hi,

I develop a UWP application and I get a System.Reflection.AmbiguousMatchException when I try to add an element to the db. My class hasn't any linked class (no foreign key).
I use the Add method inherited from DbContext.

I get this issue only in Release mode, but not in Debug mode.

Exception message: "RFLCT_Ambiguous"
Stack trace:
at System.SharedTypeExtensions.GetAnyProperty(Type type, String name)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.SnapshotFactoryFactory.CreateSnapshotExpression(Type entityType, ParameterExpression parameter, Type[] types, IList`1 propertyBases)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.SnapshotFactoryFactory.CreateConstructorExpression(IEntityType entityType, ParameterExpression parameter)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.SnapshotFactoryFactory`1.Create(IEntityType entityType)
at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityType.<>c.<get_OriginalValuesFactory>b__141_0(EntityType entityType)
at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityType.get_OriginalValuesFactory()
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.OriginalValues..ctor(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues()
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState entityState, Boolean acceptChanges)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode node)
at System.Predicate`1.InvokeOpenStaticThunk(T obj)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph(EntityEntryGraphNode node, Func`2 handleNode)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState entityState)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(InternalEntityEntry entry, EntityState entityState)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState[TEntity](TEntity entity, EntityState entityState)
at Microsoft.EntityFrameworkCore.DbContext.Add[TEntity](TEntity entity)

Further technical details

EF Core version: v 1.0.0
Operating system: Windows 10 Mobile v 10.0.14393.5
Visual Studio version: VS Community 2015

Thanks

@SamuelLioult

This comment has been minimized.

Show comment
Hide comment
@SamuelLioult

SamuelLioult Aug 4, 2016

According to this post http://stackoverflow.com/questions/18245686/entity-framework-exception-ambiguous-match-found
I done a workaround to pass the problem. (But I don't understand why it works fine in Debug mode...)

SamuelLioult commented Aug 4, 2016

According to this post http://stackoverflow.com/questions/18245686/entity-framework-exception-ambiguous-match-found
I done a workaround to pass the problem. (But I don't understand why it works fine in Debug mode...)

@divega

This comment has been minimized.

Show comment
Hide comment
@divega

divega Aug 8, 2016

Member

@natemcmaster possible bug in .NET Native.

Member

divega commented Aug 8, 2016

@natemcmaster possible bug in .NET Native.

@divega divega added this to the 1.1.0 milestone Aug 8, 2016

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Aug 8, 2016

Member

@SamuelLioult your issue doesn't contain enough information for us to reproduce this problem and it's not a known issue I recognize. Can you you share more information?

### Steps to reproduce
Ideally include a complete code listing that we can run to reproduce the issue.
Alternatively, you can provide a project/solution that we can run.

A zipped-up project is best as this is most definitely a .NET Native issue. I'll need to know how the .NET Native compiler is behaving to understand reasons for the error.

Also, the stackoverflow post you referenced is probably a red herring: EF 5 and EF Core have a very different stack.

Member

natemcmaster commented Aug 8, 2016

@SamuelLioult your issue doesn't contain enough information for us to reproduce this problem and it's not a known issue I recognize. Can you you share more information?

### Steps to reproduce
Ideally include a complete code listing that we can run to reproduce the issue.
Alternatively, you can provide a project/solution that we can run.

A zipped-up project is best as this is most definitely a .NET Native issue. I'll need to know how the .NET Native compiler is behaving to understand reasons for the error.

Also, the stackoverflow post you referenced is probably a red herring: EF 5 and EF Core have a very different stack.

@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Aug 15, 2016

Member

Closing as we haven't heard back yet on the request for more details. We can reopen for more investigation if we can get a repro project.

Btw, I'm not closing just to be mean. We got a lot of traffic and bug reports. It's hard to for us reproduce errors with only fragments of information. To maximize our time building features and investigating bugs, we ask for folks to give us a self contained way to reproduce the issue.

Member

natemcmaster commented Aug 15, 2016

Closing as we haven't heard back yet on the request for more details. We can reopen for more investigation if we can get a repro project.

Btw, I'm not closing just to be mean. We got a lot of traffic and bug reports. It's hard to for us reproduce errors with only fragments of information. To maximize our time building features and investigating bugs, we ask for folks to give us a self contained way to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment