I use Entity FrameWork 5.0 and MySql connector 6.7.4 . I have a simple MVC Razor 4 application. When I start my appliaction there is an error like this :
Could not load file or assembly 'MySql.Data, Version=6.6.5.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)
I tried that unload and load my MySqlData dll from NuGet but it didn't work. What should I do?
As you are using
EF5
a corollary is that you have to use version4.5
of the framwework. This then requires that you use version6.7.4.0
of the MySql connector libraries as you've stated, yet your error implies that you are using version6.6.5.0
for .Net 4.0.You need to remove the current version you have and download the correct version from NuGet. Alternatively, you can download directly from the MySql Dev site
Also, make sure that you reference
MySql.Data
,MySql.Data.Entity
andMySql.Web
in your application, and that they are all version6.7.4.0
.You may also need to update the
<system.data>
section of yourweb.config
. Try this: