实体框架-创建csdl,ssdl和msl文件 [英] Entity framework - create the csdl, ssdl and msl files

查看:123
本文介绍了实体框架-创建csdl,ssdl和msl文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用EF 4(当前不使用自我跟踪实体)。我向我的一个实体添加了一些列(它们都不是键,并且所有列都可以为空),并且得到了概念类型的成员数与对象上的成员数不匹配边类型例外。

我遵循了接受的答案,概念类型不会与成员上的成员数量不匹配。但是,我得到的是,该实体不再出现在我的edmx中。我已经从数据库中重新添加了它,但是仍然遇到相同的异常。

我认为问题在于我已经将csdl / ssdl / msl文件复制到了正在执行的程序集目录中。我想复制更新的文件,但是不会再次创建(它们曾经在我的EF项目的 obj\Debug\edmxResourcesToEmbed 文件夹中创建) ,甚至在删除它们后也没有。

是否可以重新创建这些文件?

谢谢。

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.

PS:由于我不想发布过多的代码,所以我还没有添加任何东西,但是我很乐意添加所需的信息, m只是不确定不确定到底需要什么。

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.

推荐答案

因此,如果您要创建csdl,ssdl和amd msl文件,请执行

So if you want to create the csdl, ssdl amd msl files, do the following:


  1. 转到您的edmx文件。

  2. 单击显示模型的GuI屏幕

  3. 切换到属性窗口(我不知道需要从GUI区域访问它,而不是右键单击解决方案资源管理器中的文件。

  4. 元数据工件过程中,选择已嵌入输出程序集

  1. Go to your edmx file.
  2. Click on the GuI screen that shows the model.
  3. Switch to the property window (I didn't know that it needs to be accessed from the GUI area and not by right clicking the file in the Solution Explorer.
  4. In the Metadata Artifact Process select Embed in Output Assembly.

完成并完成后,文件将显示在 obj下的 Debug\edmxResourcesToEmbed obj\x86 ,取决于您的内部定义。

如果这似乎很容易解释,对不起,但我需要这些说明(msdn不是一个格雷在帮助下),希望对其他人有帮助。

Done and done, the files will appear in Debug\edmxResourcesToEmbed under obj or obj\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.

这篇关于实体框架-创建csdl,ssdl和msl文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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