Issue one: " failed to load file or assembly" EntityFramework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"
Cause:
With the NuGet management package, there are different versions of the Entity Framework in the same solution, and it is possible to install different versions of the Entity Framework at different times, so this problem occurs.
Solution:
1. NuGet Package for Management solution, tool-and library packages manager
2. If there are two entityframework installed, then uninstall one (i uninstalled the lower version)
3. Otherwise, locate EntityFramework in the installed package, select it, then click the "Update" button
4. Select the items you want to update (typically automatically default to the items that need to be updated), click the "OK" button
5. Wait for the update to complete and resolve.
Issue two: In the Run Program Times error: " if used in code first mode, the code generated for Database first and model first development using the T4 template may not function correctly." To continue using Database first or Model first, make sure that you specify the Entity Framework connection string in the config file that executes the application. To use the classes generated from Database first or Model first for code first, add any additional configuration using the attributes or Dbmodelbuilder API, and then remove the code that throws the exception. "Normal at compile time.
Solution:
Modify the method "Onmodelcreating" under the context class to:
1 protected Override void onmodelcreating (Dbmodelbuilder modelBuilder) 2 {3 modelbuilder.conventions.remove<pluralizingtablenameconvention>(); 4 Base . Onmodelcreating (ModelBuilder); 5 6 // throw new Unintentionalcodefirstexception (); 7 }
Problems and solutions in building EF6.0+MVC4 frame