-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
PendingModelChangesWarning exception thrown when upgrading to .NET 9 #35158
Comments
same with sql server, await context.Database.MigrateAsync(); |
when doing this:
the taken from here: |
Hi @wstaelens. I tried that and it works. Thanks for that. However, I still believe there is an underlying bug here. This exception is not supposed to be thrown in the first place. There are not pending model changes. |
See also #35110 |
Can you provide a runnable repro project? |
I can't find information about this change anywhere in What's New nor Breaking Changes. We had a changes that mean a migration needs to be generated in our code, so the "warning" is correct, but this is not a warning, it's a straight up error. The fact that this works in EF Core 8.0 and not EF Core 9.0 seems like a breaking change or regression rather than something that should just be thrown in. I get the motivation behind it being that it could cause "hard to track runtime errors", but it's not an excuse to break compatibility surely? Changing this to be an actual warning (ie. something shown at startup) would make much more sense, as it's really down to the user to handle it. |
We just migrated from .NET 8 to .NET 9, following the migration guide provided by the ASP.NET Core team.
After having completed the steps of the guide and upgraded all SDK and package references to
9.0
, we ran into the following exception when running the app.The exception is thrown in the following code block, which sits in
Program.cs
after thevar app = builder.Build();
statement.The code block above has worked without any issues from .NET 6.0 through .NET 8.0.
There are no outstanding changes/migrations in our project. We branched out from our main branch (on .NET 8), which builds without any issues, so we are very puzzled by this error.
Is this a bug in the newly released version of EF Core or are we missing something in our migration?
EF Core version: 9.0.0
Database provider: Npgsql.EntityFrameworkCore.PostgreSQL 9.0.1
Target framework: .NET 9.0
Operating system: macOS Sonoma 14.6.1
IDE: JetBrains Rider 2024.3
The text was updated successfully, but these errors were encountered: