I have ASP.Net MVC
site.
Technology Stack
- ASP.Net 4.6
- C#.Net
- EF 6
- MySQL -Database
While I am trying to generate the database using Nuget
command:-
Enable-Migrations -force
I am getting the below exception
The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception.
Following things are already cross checked & tried by me:-
My App.Config:-
<connectionStrings>
<add name="mydbContext" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;port=8080;database=mydb;uid=root;password=" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
</providers>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…