这是我在出现此错误之前所做的:
这是错误:
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
这是我尝试过的:
查看 proj 文件,我看到了这个:
<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>
可能的根本原因是什么?
最佳答案
我想通了这个问题。 EntityFramework.dll 需要在 GAC 中,Visual Studio 才能从包管理器中使用它。
注意:此时完全重新启动计算机可能是明智之举。
我不确定为什么 Visual Studio 不再看到 DLL,但这让我解决了这个问题。
关于entity-framework - Entity Framework 代码第一次迁移抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13832417/