# EF Core 9: System.InvalidOperationException: An error was generated for warning 'PendingModelChangesWarning': The model for context 'X' has pending changes

**Code:** `PendingModelChangesWarning` · **Category:** .NET · **Seen on:** .NET, EF Core

The EF model differs from the last migration snapshot, and EF Core 9 now throws on `Migrate()`.

## Meaning

EF Core 9 checks that the model matches the snapshot when applying migrations. Changes to entities without a new migration trigger the error.

## Common causes

- Entity or configuration changed without `dotnet ef migrations add`
- Migration snapshot not committed
- Database provider upgrade changed the model
- Different model per environment

## Quick fix

1. Run `dotnet ef migrations add <Name>`
2. Commit the snapshot (`*ModelSnapshot.cs`)
3. Suppress only deliberately with `ConfigureWarnings`

## Detailed fix by platform

### CLI

1. `dotnet ef migrations add Sync && dotnet ef database update`

## How to diagnose

1. **Changes** — Model edits without migration?
2. **Snapshot** — Up to date?
3. **Version** — EF Core 9?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/dotnet/ef-pending-model-changes-warning)
