Skip to content

ASP.NET Core – Web Project Entity Framework “Fragment” Exception on Migration Execution

I recently started a new hobby project, requiring me to spin up a new ASP.NET Core project. I’m using Postgres as my RDBMS – and needed to make some modifications, recreate my initial migration, and execute it.

Method ‘Fragment’ in type ‘Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper’ from assembly ‘Microsoft.EntityFrameworkCore.Design, Version=6.0.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ does not have an implementation.

Unfortunately, it looks like the default ASP.NET Core web project has a bit of a missing NuGet Package. Easily resolved!

  1. Install the Microsoft.EntityFrameworkCore.Design NuGet package.
  2. Run Add-Migration Initial via Package Manager Console.
  3. Run Update-Database via Package Manager Console.
  4. Validate the migration ran successfully.
Published in.NET

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *