Entity Framework - The migrations configuration type was not be found in the assembly

c# entity-framework entity-framework-6

Question

I have multiple dbcontexts in a C# project and I'm trying to enable migrations, when I specify the full command ie:

"Enable-Migrations -ContextTypeName Models.Account.AccountDetailDbContext"

A migrations folder is created, with the configuration class

I then get a message:

"Checking if the context targets an existing database..."

And then

"The migrations configuration type 'Portal.WebUI.Migrations.Configuration' was not be found in the assembly 'Portal.WebUI'."

Even though it has just created the file it can't find it.

Can anyone help on this please?

I have the correct project selected in the Package Manager Console

I have tried the command using -verbose, but it gives no additional information

If I copy the dbcontexts and classes into a new project then it all works, so it must be something in this existing project that it making the migration fail, but I can't tell what it is.

Thanks in advance for any answers

1
2
8/17/2016 4:10:00 PM

Popular Answer

I managed to resolve this by uninstalling the EF nuget package and then reinstalling it.

Rather annoying...but I hope it helps someone else.

3
8/18/2016 7:44:12 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow