实体框架 - 创建 csdl、ssdl 和 msl 文件
我使用 EF 4(目前不使用自我跟踪实体)。我已向我的实体之一添加了一些列(其中没有一个是键,所有列都可以为空),并得到概念类型中的成员数量与对象端类型上的成员数量不匹配< /code> 异常。
文件夹中创建),甚至在删除它们之后也不会创建。< br> 有什么办法可以再次创建这些文件吗?
我遵循了接受的答案 这里 但我从中得到的只是这个实体不再出现在我的 edmx 中。我已从数据库重新添加它,但我不断收到相同的异常。
我认为问题是我已将 csdl/ssdl/msl 文件复制到我的执行程序集目录中。我想复制更新的文件,但它们不会再次创建(它们曾经在我的 EF 项目的 obj\Debug\edmxResourcesToEmbed
谢谢。
PS:由于我不想发布过多的代码,所以我还没有添加任何内容,但我很乐意添加所需的信息,我只是不确定到底需要什么。
I work with EF 4 (not with Self-tracking entities currently). I've added some columns (non of them is a key and all of the are nullable) to one of my entities, and got the Number of members in conceptual type does not match with number of members on object side type
exception.
I've followed the accepted answer here but all I got from that was that this entity does not appear in my edmx anymore. I've re-added it from DB, but I keep getting the same exception.
I think the problem is that I've copied the csdl/ssdl/msl files to my executing assembly directory. I'd like to copy the updated files, but they're not created again (they were once created in the obj\Debug\edmxResourcesToEmbed
folder of my EF project), not even after removing them.
Any way to get those files created again?
Thanks.
P.S: As I don't want to publish excess amounts of code, I don't add anything yet but I'll be happy to add needed information, I'm just not sure what exactly is needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,如果您想创建 csdl、ssdl amd msl 文件,请执行以下操作:
Metadata Artifact Process
中选择Embed在 Output Assembly
中完成后,文件将出现在
obj
或obj\x86
下的Debug\edmxResourcesToEmbed
中,具体取决于您的构建定义。如果这看起来解释起来很简单,我很抱歉,但我需要这些说明(msdn 没有太大帮助),我希望它可以帮助其他人。
So if you want to create the csdl, ssdl amd msl files, do the following:
Metadata Artifact Process
selectEmbed in Output Assembly
.Done and done, the files will appear in
Debug\edmxResourcesToEmbed
underobj
orobj\x86
, depends on your build definitions.I'm sorry if this seems to simple to explain, but I was in need for those instructions (msdn was not a great help) and I hope it might help others.