I am using MySQL with dotConnector from Devart. I’m trying to use the code-first with migrations that the library offers. It creates the migrations just fine, but when I try to call Update-Database in the package manager I’m getting this error
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Digging through my reference list, I’m using EntityFramework 5.0.0.0 and am targeting the v4.5 framework. Why would this be asking for v4.4 of EF?
I set up two connection strings, one using the regular MySQL provider, the other using dotConnector’s MySQL provider, it didn’t make a difference which one my context used. I’ve tried removing and re-adding the EF reference.
I’m so lost on this I don’t even know what other information to give to help get a constructive answer. So, if there is more information I should give to help get a better answer, please let me know.
I’ve found more information about dotConnect and it looks like the Migrations portion targets 4.4. Does this mean I need to use EF 4.4? Or can I have both somehow so the migration has what it needs and I can use EF 5.0 everywhere else?
EF 4.4 is .NET 4.0 version of EF 5.0. It looks like something in your project is targeting .NET 4.0 (or is built for .NET 4.0).