You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to execute migrations without the .NET Core SDK installed #807
I keep getting told the project can't be found. Why is the project necessary? The code is contained in the dlls. How do I take my published code as an artifact and run the database update?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 263f21d6-6edc-7582-e0e2-fa1c9670bcc0
Version Independent ID: b3dd8c84-18b1-f98d-64f1-7897d1482692
changed the title [-]How to do a migration with published code?[/-][+]Document how to execute migrations without the .NET Core SDK installed[/+]on Aug 28, 2019
So we don't need to know where is Microsoft.EntityFrameworkCore.Tools installed and we can run migrations much easily.
With powershell something like that:
Migration bundles, introduced in EF Core 6, provide the requested deployment artifact. A bundle contains the compiled migration code, does not require project source or dotnet ef on the deployment machine, and can include the .NET runtime when generated with --self-contained.
Activity
jsancho commentedon Aug 17, 2018
Not that straightforward to do manually.
We have ended up using the VSTS task from Ben Day, he's also published scripts for win/linux to execute the migrations.
https://www.benday.com/2018/07/05/deploy-entity-framework-core-2-1-migrations-from-a-dll/
ajcvickers commentedon Oct 1, 2018
See also the discussion here: dotnet/efcore#13339
Specifically, it would be useful to:
bricelam commentedon Jan 18, 2019
benday's tool: Build & Release Tools
jholovacs commentedon Jan 18, 2019
I'm doing a workaround now by creating an idempotent migration script in my build:
...then I run this like any other sql script in a powershell window. It seems a little kludgy, but... eh, it works.
[-]How to do a migration with published code?[/-][+]Document how to execute migrations without the .NET Core SDK installed[/+]zordark commentedon Nov 23, 2020
We are working in .net 4.8 environment and using next workaround.
In csproj file with migrations we are coping all dependencies to output folder:
So we don't need to know where is
Microsoft.EntityFrameworkCore.Toolsinstalled and we can run migrations much easily.With powershell something like that:
with dotnet core you can do the same, all you need is replace
ef.exepath withef.dllpath, something like that:\tools\netcoreapp2.0\any\ef.dllAndriySvyryd commentedon Aug 5, 2026
Migration bundles, introduced in EF Core 6, provide the requested deployment artifact. A bundle contains the compiled migration code, does not require project source or
dotnet efon the deployment machine, and can include the .NET runtime when generated with--self-contained.Expand and clarify migrations guidance. (#5445)