Monday, February 29, 2016

More than one migrations configuration type was found in the assembly 'MyData'. Specify the name of the one to use.

I was recently running an Add-Migration command using Entity Framework Code First Migrations, when I encountered the following error message:

"More than one migrations configuration type was found in the assembly 'MyData'. Specify the name of the one to use."

As I soon discovered, I was using multiple Configuration.cs classes (to correspond to my multiple DbContext instances) in my assembly, thus causing the Add-Migration command to fail with this error message.

Therefore, I had to modify the command to be the following instead:


Add-Migration "MyMigration" -ProjectName "MyProject" -StartUpProjectName "MyProject" -ConnectionStringName "MyConnString" -ConfigurationTypeName "MyMigration.Configuration" -Force Verbose

1 comment:

  1. Every one deserves to be happy in their family or relationships, I was lucky enough to get my husband back , Doctor Robbinson helped me he is authentic , My Husband left me for 8 months and I was devastated and couldn't find any way out to get him back i tried all ways. At some point I was depressed, while i was reading through some post on the internet where people testified about how Dr Robbinson helped them Solve similar problems I contacted him and he never hesitated to help me as well, My husband is back home, my happiness is restored
    Text/call: +12267705795
    Email: Drrobbinssonspiritualhome@gmail.com

    ReplyDelete