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

PBG picture PBG · May 21, 2013 · Viewed 23.7k times · Source

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.

Answer

PBG picture PBG · May 23, 2013

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