Another workaround for the EF Core FileLoadException / DiagnosticSource problem

Posted · Add Comment

Have you tried doing a “dotnet ef migrations” or “dotnet ef database update” command for Entity Framework Core and gotten this error? System.IO.FileLoadException: Could not load file or assembly ‘System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: ‘System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ at […]

Deploy Entity Framework Core Migrations from a DLL

Posted · Add Comment

[Updated 3/29/2017 — Added a bash version of this script for deploying EF Core Migrations from Linux.] Entity Framework Migrations let you deploy incremental updates to a target database.  With Entity Framework Core (EF Core) this is done from the command line by going to the directory that contains your Entity Framework entity and migration code, […]

A Non-Terrible Workaround for the Dreaded EF Core Migration FileLoadException Diagnostics Problem

Posted · 1 Comment

In my Entity Framework Core Migrations walkthrough, I showed a workaround for an exception when you add a migration.  If you ran “dotnet ef migrations add” on a netcoreapp1.1 project, you’d get the following exception. System.IO.FileLoadException: Could not load file or assembly ‘System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The located assembly’s manifest definition does not match the […]

Walkthrough: Entity Framework Core 1.1 with Migrations

Posted · 5 Comments

Here’s a walk-through on how to create a new solution that uses an ASP.NET Core project, an MSTest unit test project, and Entity Framework Core 1.1 (EFCore1.1).  I’m not sure if you’ve found this to be the case but I’ve been struggling with the documentation for a few days trying to figure out how to […]