EntityFramework.SqlServer 在发布模式中缺失

EntityFramework.SqlServer missing in release mode

我的 XAF Winforms 应用程序中有几个模块。 最低层使用由 Nuget 安装的 Entity Framework 6.2。

应用程序 运行 在调试模式下运行良好。

但是在发布模式下,我得到以下警告建筑。

Severity    Code    Description Project File    Line    Suppression State
Warning     Could not resolve this reference. Could not locate the assembly 
"EntityFramework.SqlServer". Check to make sure the assembly exists on disk. 
If this reference is required by your code, you may get compilation errors.
SBD.JobTalk.Workflow.Module.Win C:\Program Files (x86)\Microsoft Visual   Studio17\Professional\MSBuild.0\Bin\Microsoft.Common.CurrentVersion.targets 2110    

在运行时变成

Application: SBD.JobTalk.Workflow.Win10.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
   at SBD.JobTalk.Workflow.Module.WorkflowModule..cctor()

Exception Info: System.TypeInitializationException
   at SBD.JobTalk.Workflow.Module.WorkflowModule..ctor()
   at SBD.JobTalk.Workflow.Win.WorkflowWindowsFormsApplication.InitializeComponent()
   at SBD.JobTalk.Workflow.Win.WorkflowWindowsFormsApplication..ctor()
   at SBD.JobTalk.Workflow.Win.Program.Main()

我正在使用 Framework 4.7.2 和 Desktop Bridge Entity Framework 正在使用代码优先。 启动项目是 packages

我在 Dev Express XAF 向导创建的新 XAF 应用程序中没有遇到问题。

我正在使用一个共享项目,灵感来自 this blog

如果我添加 Entity Framework 对 Module.Win、Win 和 Win10 项目的引用,问题就会消失

也许这只是共享项目的问题?

似乎 Entity Framework 需要在所有层中引用。