Skip to content

Add NoBuild parameter to Add-Migration PMC command#38658

Open
AndriySvyryd with Copilot wants to merge 2 commits into
mainfrom
copilot/add-nobuild-parameter-to-add-migration
Open

Add NoBuild parameter to Add-Migration PMC command#38658
AndriySvyryd with Copilot wants to merge 2 commits into
mainfrom
copilot/add-nobuild-parameter-to-add-migration

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Add-Migration lacked a -NoBuild switch, unlike dotnet ef migrations add --no-build, leaving PMC users unable to skip the build step when the project is already up-to-date.

This is useful as a workaround for issues like #38572

Changes

  • EntityFrameworkCore.psm1: Added [switch] $NoBuild parameter to Add-Migration; passes -skipBuild:$NoBuild to the internal EF helper to conditionally skip the solution build
  • EntityFrameworkCore.PS2.psm1: Added $NoBuild to the PS2 stub's signature (stub always throws "upgrade PowerShell"; parameter presence prevents argument rejection)
  • Updated .PARAMETER NoBuild help comment in both files

Usage

Add-Migration InitialCreate -NoBuild

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title Add NoBuild parameter to Add-Migration PMC command Add NoBuild parameter to Add-Migration PMC command Jul 15, 2026
Copilot AI requested a review from AndriySvyryd July 15, 2026 23:32
@AndriySvyryd AndriySvyryd requested a review from Copilot July 15, 2026 23:33
Comment thread src/EFCore.Tools/tools/EntityFrameworkCore.PS2.psm1 Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a -NoBuild switch to the EF Core Package Manager Console Add-Migration command so PMC users can skip the Visual Studio solution build step (similar in intent to dotnet ef ... --no-build), helping scenarios where rebuilding is unnecessary or problematic.

Changes:

  • Added [switch] $NoBuild to Add-Migration in EntityFrameworkCore.psm1 and forwarded it to the internal EF helper via -skipBuild:$NoBuild.
  • Added the same parameter to the PowerShell 2 stub (EntityFrameworkCore.PS2.psm1) so the command surface accepts it (even though the stub still throws).
  • Updated parameter help text to document NoBuild.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/EFCore.Tools/tools/EntityFrameworkCore.psm1 Adds -NoBuild to Add-Migration and forwards it to the internal EF helper to conditionally skip the build step.
src/EFCore.Tools/tools/EntityFrameworkCore.PS2.psm1 Updates the PS2 stub signature/help to include -NoBuild to prevent argument rejection.

Comment thread src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Comment thread src/EFCore.Tools/tools/EntityFrameworkCore.PS2.psm1 Outdated
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI requested a review from AndriySvyryd July 15, 2026 23:40
@AndriySvyryd AndriySvyryd marked this pull request as ready for review July 15, 2026 23:41
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner July 15, 2026 23:41
Copilot AI review requested due to automatic review settings July 15, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@AndriySvyryd AndriySvyryd requested a review from cincuranet July 15, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants