Here is what I did before I got this error:
- Installed EF (the pre release version, 6 maybe, I dunno)
- decided I did not want, so uninstalled that and reinstalled the stable version (5)
- Truncated my database via SSMS
here is the error:
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicK eyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from H RESULT: 0x80131040)" At C:\Projects\BCATracker.Web\packages\EntityFramework.6.0.0- alpha2\tools\EntityFramework.psm1:425 char:31 + $domain.CreateInstanceFrom <<<< ( + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodTargetInvocation Here is what I have tried:
- Delete everthing from the bin directory, rebuild.
- remove EF from nuget, delete the file in the packages directory, readd ef in nuget.
Looking at the proj file I see this:
<Reference Include="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath> </Reference> What could be a possible root cause?


Install-Updates EntityFrameworkor use GUI - make sure you are not installing EF6. This should get you EntityFramework.dll 4.4.0.0 which is EF5 for .NET Framework 4. You should also be able to use Uninstall-Package now. When I want to retarget .NET Framework version - I always uninstall EF first, retarget and install EF again to be sure that I have the correct version.