EF Core Migration Buddy
EF Core Migration Buddy is a VS Code extension for people who use Entity Framework Core migrations and are tired of retyping the same long dotnet ef commands.
It does not replace EF Core. It wraps the official dotnet ef CLI with workspace-aware presets and focused forms inside VS Code, so the common migration flows become much faster and more predictable.
Why
In many .NET solutions, the DbContext lives in one project and the executable startup host lives somewhere else:
src/Project.Persistence/Project.Persistence.csproj
src/Project.Api/Project.Api.csproj
That usually means migration commands become easy to forget:
dotnet ef migrations add <migration_title> \
--project src/Project.Persistence/Project.Persistence.csproj \
--startup-project src/Project.Api/Project.Api.csproj \
--context ProjectDbContext \
--output-dir <output_path (ex: Migration/Project)>
EF Core Migration Buddy turns that into:
EF: Add Migration
Now the extension turns those flows into dedicated forms where you pick the DbContext, confirm the Startup project, and run the operation without rebuilding the command by hand.
Features
- Detect
.sln and .csproj files in the current workspace.
- Find likely EF Core projects through
Microsoft.EntityFrameworkCore* package references.
- Detect
DbContext classes in C# files.
- Suggest migration presets for split projects such as
Api + Persistence.
- Read and create
.vscode/efcore.json.
- Open dedicated forms for each supported EF migration flow.
- List all discovered projects in
Startup project selectors.
- Load migrations dynamically in flows that need migration selection.
- Run commands through VS Code tasks.
- Generate idempotent migration scripts as
.sql files in the workspace root.
- Show friendlier diagnostics for common design-time EF Core failures.
Commands
EF: Add Migration
EF: Remove Last Migration
EF: Update Database
EF: Script Migration
Current command scope is intentionally focused on the main migration lifecycle.
Solution Explorer Integration
The extension adds an Entity Framework submenu to the C# Dev Kit Solution Explorer, so the main EF flows are available directly from the solution context menu.

Every active command follows the same UI pattern:
DbContext selector first
Startup project as a dropdown listing all discovered projects
- Default values preselected from the inferred preset
- Context summary on the right side
- Direct execution after submitting the form
Add Migration
Use this flow to create a new migration with:
DbContext
Migration name
Output directory
Startup project

Remove Last Migration
Use this flow to remove the latest migration for a selected context.

Update Database
Use this flow to update the database to a selected migration.
Target migration is loaded dynamically from dotnet ef migrations list
- The list is filtered to real EF migrations only
- Items are ordered from newest to oldest

Script Migration
Use this flow to generate an idempotent SQL script.
From migration is loaded dynamically and ordered from oldest to newest
To migration is loaded dynamically and ordered from newest to oldest
Startup project is selectable from all discovered projects

Workspace Config
The extension uses .vscode/efcore.json for workspace presets.
Example:
{
"defaultContext": "ProjectDbContext",
"migrations": [
{
"name": "Project",
"project": "src/Project.Persistence/Project.Persistence.csproj",
"startupProject": "src/Project.Api/Project.Api.csproj",
"context": "ProjectDbContext",
"outputDir": "Migrations/Project"
}
]
}
If the file does not exist, the extension can scan the workspace and offer to create one from the discovered DbContext candidates.
Requirements
- VS Code
1.90.0 or newer.
- .NET SDK installed and available on your
PATH.
- EF Core CLI available through your project or globally:
dotnet tool install --global dotnet-ef
To update an existing global install:
dotnet tool update --global dotnet-ef
How To Use
- Open a .NET workspace in VS Code.
- Open the Command Palette or use the
Entity Framework submenu from the C# Dev Kit Solution Explorer.
- Run one of the supported commands.
- Select the
DbContext.
- Review or change the
Startup project.
- Fill the remaining fields for the selected flow.
- Submit the form.
The extension runs the command in a VS Code task and shows output in the terminal panel.
EF: Script Migration always generates an idempotent SQL script with --idempotent and writes it to the workspace root, using a file name like efcore-project-migration-script.sql.
Diagnostics
EF Core Migration Buddy looks for common failure patterns in dotnet ef output and suggests a more direct next step, including:
- Missing or incorrect
--startup-project.
- EF Core failing to create the
DbContext at design time.
- Startup host code blocking migrations.
DbContext dependencies such as IHttpContextAccessor causing design-time failures.
- Missing
.Designer.cs migration companion files.
Current Scope
This is an early V1 focused on the most common EF migration flows inside VS Code.
It intentionally does not:
- Reimplement EF Core.
- Parse or edit migration files directly.
- Replace
dotnet ef.
- Cover every EF CLI command yet.
Development
Install dependencies:
npm install
Build:
npm run build
Run tests:
npm test
Launch the extension locally:
Press F5 in VS Code
This opens a new Extension Development Host window with EF Core Migration Buddy loaded.
Packaging
Create a VSIX package:
vsce package
Publish to the Visual Studio Marketplace:
vsce publish
License
MIT