EntityFramework.SqlServer在发布模式下丢失 [英] EntityFramework.SqlServer missing in release mode

查看:214
本文介绍了EntityFramework.SqlServer在发布模式下丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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    

在运行时变成

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 实体框架正在使用代码优先". 启动项目是软件包

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

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

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

如果我将实体框架引用添加到Module.Win,Win和Win10项目中,问题就会消失

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?

推荐答案

似乎在所有层中都需要引用实体框架.

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

这篇关于EntityFramework.SqlServer在发布模式下丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆