使用Entity Framework遇到MetadataException: Unable to load the specified metadata resource
2019-08-04 06:47
525 查看
原文链接:https://www.geek-share.com/detail/2505944240.html
项目中使用了Entity Framework, 然后在一个单元测试项目中引用包含了edmx的项目,跑测试时,遇到了MetadataException: Unable to load the specified metadata resource。
Google后找到了解决办法,在Entity Framework生成的连接字符串中,包含了"metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;"这一段。其中的*表示将在所有程序集中查找Model.csdl, Model.ssdl, Model.msl这3个资源。然而在有些情况下似乎并不能正确的找到,而将其改为显示指定就可以解决:
metadata=res://Something.Data/Model.csdl|res://Something.Data/Model.ssdl|res://Something.Data/Model.msl;
这里一篇博客介绍了更详细的信息。
转载于:https://www.cnblogs.com/Gildor/archive/2011/01/14/1935149.html
相关文章推荐
- 使用Entity Framework遇到MetadataException: Unable to load the specified metadata resource
- ADO.NET Entity Framework “Unable to load the specified metadata resource”解决方法
- 无法加载指定的元数据资源Unable to load the specified metadata resource
- ADO.NET实体框架连接串引发的异常:Unable to load the specified metadata resource
- Entity Framework出现System.Data.MetadataException: Unable to load the specified metadata resource的解决方法
- Unable to load the specified metadata resource
- 无法加载指定的元数据资料Unable to load the specified metadata resource
- ADO.NET实体框架连接串引发的异常:Unable to load the specified metadata resource
- ADO.NET实体框架连接串引发的异常:Unable to load the specified metadata resource
- 使用Genymotion遇到的坑_Genymotion无法启动_unable to start the virtual device
- 关于使用springmvc时Failed to load resource: the server responded with a status of 400 (Bad Request)错误可能原因
- Yii中使用gii遇到“unable to write the file”
- 使用struts和spring开发时遇到Unable to load configuration. - action - |Caused by: Action class [login] not found - action -
- 关于使用springmvc时Failed to load resource: the server responded with a status of 400 (Bad Request)错误可能原因
- monogame Unable to load DLL 'openal32.dll': The specified module could not be found
- Connector/Net 连接 MySQL远程服务器出现 "Unable to connect to any of the specified MySQL hosts" 解决方法
- 让人哭笑不得的“Unable to load one or more of the types in the assembly”问题的解决!
- 安装Eclipse插件,遇到当安装在它成功,按它的要求重启后出现一个错误(Unable to open the workbench,see the error logs)
- 使用Microsoft.XMLHTTP取数据时The system cannot locate the resource specified错误处理