You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EF Core 6 breaking change list does not include a new exception #4315
After upgrading EF Core from 5.0.17 to 6.0.15, it looks like the event ID CoreEventId.NavigationBaseIncludeIgnored now throws an exception by default. However I can't find anywhere that this change is documented. Maybe I'm missing something here, but I think the breaking change page should cover it?
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 85900c12-01b3-fe3a-b1a0-ca0874f18fe3
Version Independent ID: 70a41a5d-3667-c318-b8c3-5fe267b3d314
As far as I can tell, it was throwing in 5.0 as well. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
I was getting some intermittent behaviour when testing this locally that I think is down to NuGet caching. I added a GitHub Actions workflow to the repo to test in a more sterile environment. You can see the results in this run.
To summarize the results for different Microsoft.EntityFameworkCore.Sqlite versions:
5.0.4 and below:
Throws a different/internal exception - I believe this to be related to incompatibility with .NET 6, so ignoring for this purpose
5.0.5 up to and including 5.0.17:
No exception is thrown
6.0.0 up to and including 6.0.16:
Throws the exception: System.InvalidOperationException: An error was generated for warning 'Microsoft.EntityFrameworkCore.Query.NavigationBaseIncludeIgnored': The navigation 'TestChildEntity.Parent' was ignored from 'Include' in the query since the fix-up will automatically populate it. [...]
Note I've also been able to reproduce with Pomelo.EntityFrameworkCore.MySql (where I originally came across this), but figured SQLite would be a preferrable example to test with
Activity
ajcvickers commentedon Apr 7, 2023
As far as I can tell, it was throwing in 5.0 as well. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
DillonN-build commentedon Apr 11, 2023
@ajcvickers thanks for the response - that's interesting, it's possible we're picking it up from somewhere else. I've gone ahead and pushed a small project repo to reproduce - https://github.com/DillonN-build/ef-core-exception-test. This is using .NET 6 and testing Microsoft.EntityFameworkCore.Sqlite 5.x vs 6.x.
Program.cscontains a trivial query that sets off the error:I was getting some intermittent behaviour when testing this locally that I think is down to NuGet caching. I added a GitHub Actions workflow to the repo to test in a more sterile environment. You can see the results in this run.
To summarize the results for different Microsoft.EntityFameworkCore.Sqlite versions:
System.InvalidOperationException: An error was generated for warning 'Microsoft.EntityFrameworkCore.Query.NavigationBaseIncludeIgnored': The navigation 'TestChildEntity.Parent' was ignored from 'Include' in the query since the fix-up will automatically populate it. [...]Note I've also been able to reproduce with Pomelo.EntityFrameworkCore.MySql (where I originally came across this), but figured SQLite would be a preferrable example to test with
ajcvickers commentedon Apr 17, 2023
@DillonN-build Thanks for the repro.
Note for triage: we made this throw by default at some point, but it is not documented as a breaking change anywhere I can find.
Updates to breaking changes
Updates to breaking changes
Updates to breaking changes (#4673)