EntityFramework.SqlServer missing in release mode

余生长醉 提交于 2019-12-12 01:24:21

问题


I have several modules in my XAF Winforms application. The lowest tier makes use of Entity Framework 6.2 as installed by Nuget.

The app runs fine in debug mode.

However in release mode I get the following warning building.

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   Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2110    

At run time this turns into

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()

I am using Framework 4.7.2 and Desktop Bridge Entity Framework is using Code First. The start up project is packages

I do not get the problem in a new XAF application created by the Dev Express XAF wizard.

I am making use of a shared project with inspiration from this blog

The problem goes away if I add Entity Framework reference to the Module.Win, Win and Win10 projects

Perhaps it is just an issue with shared projects?


回答1:


It seems Entity Framework needs to be referenced in all the tiers.



来源:https://stackoverflow.com/questions/53770437/entityframework-sqlserver-missing-in-release-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!