Sachin Kainth
Sachin Kainth

Reputation: 46750

Enable-Migrations fails for EF5

I am using .NET 4.0 and Visual Studio 2010 (which I will eventually upgrade, but not quite yet). I ungraded from EF 4.1 to EF 5 via NuGet and ran Enable-Migrations (via the Package Manager Console) but got this error

No context type was found in the assembly 'UI'.

I Googled around and found this SO post.

The scenario described by the poster is slightly different as he is using VS 2012 and .NET 4.5. Either way I'm not sure if this will solve my issues. Do I need to be using VS 2012 and .NET 4.5 to use Migrations? How do I solve my issue?

Upvotes: 0

Views: 914

Answers (1)

berezovskyi
berezovskyi

Reputation: 3491

In order to NuGet commands work correctly, you should specify the default project:

enter image description here

So you should change the dropdown value from UI to Model (I presume). Actions should not depend on VS version.

Upvotes: 1

Related Questions