对于.net framework 4.8项目,当我将EF引用从6.2更新到6.4.4时,应用程序抛出错误
系统。MissingMethodException:找不到"无效系统"。数据实体基础设施LocalDbConnectionFactory。。ctor(('。
在中
public class AppContext : DbContext
{
public AppContext() : base() <--- the debugger stop on this line
Web.config有以下行
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
.......
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb"/>
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
代码或配置文件中没有任何更改,只有通过软件包管理器进行的软件包更新。
那是什么?
在我的案例中,全局缓存在某些模式下被破坏。
gacutil -u EntityFramework
解决了我的问题。