entity-frameworkentity-framework-migrations

add-migration causing a "Could not load assembly" error


Here's what I am looking at

PM> Add-Migration AddedSubdivion -StartUpProjectName Data -Verbose
Using StartUp project 'Data'.
Using NuGet project 'Registry'.
Could not load assembly 'Registry'. (If you are using Code First Migrations inside 
Visual Studio this can happen if the startUp project for your solution does not 
reference the project that contains your migrations. You can either change the startUp 
project for your solution or use the -StartUpProjectName parameter.)

I have no idea why it's trying to reference the Registry project. Registry depends on Data, not the other way around. I am very new to this, so I'd appreciate any help.


Solution

  • This is embarrassing, but maybe this will help out a googler in the future.

    At the top of the "Package Manager Console" my default project was set to the wrong project. Changing that to my models project fixed it.

    enter image description here