I recently upgraded to Visual Studio 2012 RTM Ultimate from MSDN. I'm using EF Code First Migrations to build my database in my app, and I recently added a new entity and want to scaffold the migration for it.

To do this, you need to open the Package Manage Console window in VS, and type add-migration "some name here". This will scaffold any changes to your database since the last time it was updated.

The Problem

This issue did not occur on VS 2012 RC

The problem I'm encountering is the "Default Project" dropdown in the Package Manager Console is not populated, despite having several projects in my solution. The default project that is used when I just type the command above is the wrong project (my migrations are in another project). I get the following error when I do this:

No migrations configuration type was found in the assembly 'ProjectA'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

What I've Tried

I have tried setting the correct project (ProjectB) as the startup project, only to get this error:

Could not load assembly 'ProjectA'. (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.)

The Question

How can I manually specify which project migrations are added to, or force the Default Project dropdown to populate?

You can run get-Help Add-Migration to get full help for the command. The command supports -ProjectName and -StartUpProjectName. Try to use them. I'm not sure if this help you because those empty drop downs are strange. Also try restarting VS / closing and opening Package manager if you didn't try it yet.
–
Ladislav MrnkaAug 19 '12 at 20:03

-StartupProjectName should do the trick. I have the same issue: the dropdown is empty
–
amhedAug 19 '12 at 21:01

I had a similar issue with Visual Studio 2013. Right clicking on [Solution]->[Properties]->[Startup Project] make sure [Single startup project] is selected. I previously had multiple projects selected for Azure worker role testing.