在wcf应用程序中使用"using"语句时显示错误

Mih*_*hir 1 .net wcf

我有以下代码

 using  (AdventureWorksEntities database = new AdventureWorksEntities())
Run Code Online (Sandbox Code Playgroud)

但它显示了这一点

'new_WCF_App1.AdventureWorksEntities':在using语句中使用的类型必须可以隐式转换为'System.IDisposable'

怎么解决这个问题

小智 6

using在WCF中使用数据上下文语句时出现这种错误很可能意味着您缺少对System.Data.Entity程序集的引用.