Entity Framework Core Scaffold-DbContext fails with more than one project

If you have more than one project in your solution, there is apparently an issue where running Scaffold-DbContext or Add-Migration for Entity Framework Core in the Package Manager Console will fail with the error:

System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.EntityFrameworkCore.Design, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.

According to this Github issue, there is a workaround to get this working. Set your EF project to be the startup project. It’s not an ideal resolution and doesn’t really solve the problem, but it will get you by until they fix the issue permanently.

Leave a Reply