You need to enable JavaScript to run this app. XAF WinForms EF项目报Microsoft.EntityFrameworkCore加载失败 绑定重定向无效
优惠活动
大模型
产品
解决方案
定价
更多

XAF WinForms EF项目报Microsoft.EntityFrameworkCore加载失败 绑定重定向无效

XAF WinForms混合框架引用栈的程序集加载异常问题

我有一个采用XAF WinForms、Entity Framework开发的项目,引用栈结构如下:

Framework 4.7.2 exe references
Framework 4.7.2 library1 references
.Net Standard 2.0 library2 references
.Net Standard 2.0 library3

当沿调用栈向下调用library3中的方法时,程序抛出如下异常:

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=3.1.9.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

已完成的排查与解决尝试:

  • 已在直接调用Library2的.NET Framework 4.7.2单元测试中复现该问题
  • 单元测试场景下已使用BindingRedirectGenerator生成单元测试app.config的runtime配置段,成功解决该异常
  • 将上述生成的配置段直接复制应用到主应用的app.config后,异常仍未解决

[更新进展] 目前推测问题根源为Library3调用了某框架类库,正在排查中


内容的提问来源于stack exchange,提问作者Kirsten

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.03 17:36:03