diff --git a/entity-framework/core/cli/powershell.md b/entity-framework/core/cli/powershell.md index 307c71e0a3..e254b3d9f1 100644 --- a/entity-framework/core/cli/powershell.md +++ b/entity-framework/core/cli/powershell.md @@ -124,6 +124,7 @@ Parameters: | `-Name ` | The name of the migration. This is a positional parameter and is required. | | `-OutputDir ` | The directory use to output the files. Paths are relative to the target project directory. Defaults to "Migrations". | | `-Namespace ` | The namespace to use for the generated classes. Defaults to generated from the output directory. | +| `-NoBuild` | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. | The [common parameters](#common-parameters) are listed above. @@ -319,6 +320,7 @@ Updates the database to the last migration or to a specified migration. | `-Add` | Creates a new migration and applies it to the database in a single step. Uses Roslyn to compile the migration at runtime. When specified, a migration name is required and provides the name for the new migration. Added in EF Core 11. | | `-OutputDir ` | The directory to put migration files in. Paths are relative to the target project directory. Requires `-Add`. Added in EF Core 11. | | `-Namespace ` | The namespace to use for the generated migration classes. Requires `-Add`. Added in EF Core 11. | +| `-NoBuild` | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. | The [common parameters](#common-parameters) are listed above. diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 8aef322ac0..5048a89fee 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -899,6 +899,23 @@ Explicit command-line options always take precedence over configuration file val For more information, see [Configuration file](xref:core/cli/dotnet#configuration-file). + + +### `-NoBuild` for PMC migrations commands + +Starting with EF Core 11, the Package Manager Console `Add-Migration` and `Update-Database` commands support the `-NoBuild` switch, which skips the project build step before running the command. + +This is useful when a build succeeds but produces warnings that Visual Studio's Package Manager Console treats as errors (such as NuGet vulnerability warnings), which would otherwise block the commands from running: + +```powershell +Add-Migration MyMigration -NoBuild +Update-Database -NoBuild +``` + +Only use `-NoBuild` when the project is already up-to-date, since running with a stale build may produce unexpected results. + +For more information, see the [PMC tools reference](xref:core/cli/powershell). + ### Wildcard context support for migration commands