MetadataException:无法加载指定的元数据资源 [英] MetadataException: Unable to load the specified metadata resource

查看:1758
本文介绍了MetadataException:无法加载指定的元数据资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然间我一直在我的实例化产生的的ObjectContext 类获得一个 MetadataException 。在App.config中的连接字符串看起来是正确的 - 自去年它的工作并没有改变 - 我已经试过再生从底层数据库的新模型(EDMX文件),而无需更改

All of a sudden I keep getting a MetadataException on instantiating my generated ObjectContext class. The connection string in App.Config looks correct - hasn't changed since last it worked - and I've tried regenerating a new model (edmx-file) from the underlying database with no change.

任何人有什么想法?

进一步了解详细:我并没有改变任何属性,我并没有改变任何输出程序集的名字,我没试过嵌入EDMX在装配。我只等了10小时下班,直到我回来。然后将其不工作了。

Further details: I haven't changed any properties, I haven't changed the name of any output assemblies, I haven't tried to embed the EDMX in the assembly. I've merely waited 10 hours from leaving work until I got back. And then it wasn't working anymore.

我试着重新创建EDMX。我试着重新创建项目。我甚至试图重新创建数据库,从头开始。没有运气,任何。

I've tried recreating the EDMX. I've tried recreating the project. I've even tried recreating the database, from scratch. No luck, whatsoever.

推荐答案

这意味着应用程序无法加载EDMX。有几件事情可以导致此。

This means that the application is unable to load the EDMX. There are several things which can cause this.

  • 您可能已经改变模型的MetadataArtifactProcessing属性复制到输出目录。
  • 在连接字符串可能是错的。我知道你说你没有改变,但如果你已经改变了其他事情(比如说,组件的名称),它仍然是错误的。
  • 您可能是使用后的编译任务嵌入EDMX在装配时,它不再工作因为某种原因。

总之,确实没有足够的细节在你的问题给出一个准确的答案,但希望这些想法应该让你在正确的轨道。

In short, there is not really enough detail in your question to give an accurate answer, but hopefully these ideas should get you on the right track.

更新:我写一篇博客文章更完整的步骤故障排除

这篇关于MetadataException:无法加载指定的元数据资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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