c# - 系统.Data.MetadataException : Unable to load the specified metadata resource

标签 c# asp.net-mvc-3 entity-framework edmx devart

我的连接字符串如下:

<add name="RollCallDBEntities" connectionString="metadata=res://System.Engine/RollcallNS.csdl|res://System.Engine/RollcallNS.ssdl|res://System.Engine/RollcallNS.msl;provider=Devart.Data.Oracle;provider connection string=&quot;User Id=user;Password=password;Server=127.0.0.1;Direct=True;Sid=ORCL&quot;" providerName="System.Data.EntityClient" />

我的代码如下:

using (var db= new RollCallDBEntities()) //ok
{
   var query = db.TBL_ROLLCALL.ToList(); //Unable to load the specified metadata resource.
}

我的程序集:

System.Engine

有人有什么想法吗?

这些链接没有解决我的问题:
MetadataException: Unable to load the specified metadata resource
entity framework Unable to load the specified metadata resource
Entity Framework: Unable to load the specified metadata resource
Unable to load the specified metadata resource

最佳答案

我遇到了这样的异常。问题是我重命名了我的 .edmx 文件并忘记更改 EF Web.config 文件的连接字符串中的名称:

metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;

关于c# - 系统.Data.MetadataException : Unable to load the specified metadata resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18351898/

相关文章:

c# - http rest api - 如何将响应字符串字段加载到变量

asp.net-mvc-3 - 根据验证程序,远程证书无效

c# - 如何更新 Controller 中的 .ToList() 以指向不同的表?

asp.net-mvc - Entity Framework 和MVC

c# - 如何从代理类中的 Web 服务响应中读取 http 响应 soap header

c# - 为什么 Roslyn 中的 Renamer 不重命名 AnonymousObjectMemberDeclarator ?

c# - 如何将一个类的所有字段克隆(生成代码)到另一个类中?

asp.net - MVC3 + EF4.1 Code First 但使用 .NET Memebership - 嗯?

asp.net-mvc-3 - 是否可以从 @Html.ActionLink 调用 HttpPost Action 方法?

c# - EF代码优先外键