1
I’m following the tutorial of this video to set up an ASP.NET MVC project using Entityframework6. The database used in the tutorial is Sqlserver and what I’m trying to use is Mysql.
I already have Mysql Connector installed.
I managed to execute the command "Enable-Migrations" (at 39 min. of the video) but I am having trouble executing "Update-Database -Verbose".
Follows the "header" of the error:
update-database -verbose
Using StartUp project 'ProjetoModeloDDD.MVC'.
Using NuGet project 'ProjetoModeloDDD.Infra.Data'.
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
System.TypeInitializationException: The type initializer for 'ProjetoModeloDDD.Infra.Data.Contexto.ProjetoModeloContext' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The only reference I found to "Mysql.Data" is in App.Data which appears to be in version 6.9.6.0, as well as Assembly:
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
Follow the project repository: https://github.com/feliupe/ProjetoDDD
Grateful if anyone can help.