Add-Migration command fails with "type is not resolved"(where "type" is inner entity framework class)

entity-framework, entity-framework-migrations

Solution

I was able to fix this error by right clicking on the class library that contained my migrations, and selecting "Set as StartUp Project"

Source: http://forums.asp.net/t/1978562.aspx?Getting+exception+while+running+EF+Migrations+command+in+Package+Manager+Console

Problem

I have already used an entity framework with separate migration package(for 3.5 or 4.0, don't remember), and with included migrations api(4.3, 5.0). But today i have created a new project(empty MVC4.0 project), install latest stable EF(4.3) and recieve error below on the "pm > Add-Migration initital" command ``` System.Runtime.Serialization.SerializationException: Type is not resolved for member 'System.Data.Entity.Migrations.Design.ToolingFacade+GetPendingMigrationsRunner,EntityFramework , Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner) at System.Data.Entity.Migrations.Design.ToolingFacade.GetPendingMigrations() at System.Data.Entity.Migrations.AddMigrationCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) ``` Then i am trying to switch to EF5.0 and an error still here, with one difference in a version: ``` System.Runtime.Serialization.SerializationException: Type is not resolved for member 'System.Data.Entity.Migrations.Design.ToolingFacade+GetPendingMigrationsRunner,EntityFramework , Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. ``` It is first time when i recieve this error. The "System.Data.Entity.Migrations.Design.ToolingFacade" class exists and the "GetPendingMigrationsRunner " subclass in it also exists in a referenced EntityFramework assembly. Anyone knows what may cause an error? Migrations works ok for another project on MVC4.0, on those i have choosen standart(not empty) project template. Thanks!

Original source