实体框架edmx文件在团队中重新生成不同 [英] Entity Framework edmx file regenerating differently amongst team

查看:265
本文介绍了实体框架edmx文件在团队中重新生成不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在EDMX文件中从数据库更新时遇到了很多麻烦。每当我们的一个团队成员更新它时,它会对我们其他人造成伤害。



这里有一个例子:

 < End Role =halo_formsType =Halo2Model.Store.halo_formsMultiplicity =1/> 
< End Role =halo_form_notesType =Halo2Model.Store.halo_form_notesMultiplicity =*/>

成为

 < End Role =halo_formsType =Self.halo_formsMultiplicity =1/> 
< End Role =halo_form_notesType =Self.halo_form_notesMultiplicity =*/>

注意它如何替代Halo2Model.Store。与自我我们都签出了相同的代码。



另一个例子是重新排列参数的顺序:

 < Property Name =idType =intNullable =falseStoreGeneratedPattern =Identity/> 

成为

 < Property Name =idType =intStoreGeneratedPattern =IdentityNullable =false/>对于我来说,这一切看起来都是以某种方式使用不同版本的edmx生成器,但是我很难找到有助于解释的文档。我还没有验证,但是想知道这些xml文件是否不同步可能是问题?这些xml文件怎么会失去同步,我们如何防止这种情况发生? 




  • Visual Studio 2012 Ultimate,Update 4

  • v4 .NET Framework

  • 所有的EF 6.x EntityObject Generator for C#v 1.0.1.0 Extension



开发人员1:




  • System.Data.Entity.xml,上次修改:1/10/2010 9:09 pm

  • 系统.Data.xml,1/10/20120 9:09 pm



开发人员2:




  • System.Data.Entity .xml,上次修改时间:12/12/2011 10:55 AM

  • System.Data.xml,6/15/2012 2:01 pm



更新:尝试用来自团队成员的xml文件覆盖我的文件,并没有解决edmx生成的问题。

解决方案

事实证明,我已经安装了最新版本的实体框架6.1.1 Visual Studio 2012工具,这是第一步获取实体框架:
http://msdn.microsoft.com/en-US/data/ee712906



虽然我无法确定工具本身的版本历史,但一旦我们将整个团队升级到该版本,我们就停止了问题。 p>

We're having a lot of trouble with updating from database in our EDMX file. Whenever one of our team members updates it, it blows up for the rest of us.

Here's an example diff:

<End Role="halo_forms" Type="Halo2Model.Store.halo_forms" Multiplicity="1" />
<End Role="halo_form_notes" Type="Halo2Model.Store.halo_form_notes" Multiplicity="*" />

becomes

<End Role="halo_forms" Type="Self.halo_forms" Multiplicity="1" />
<End Role="halo_form_notes" Type="Self.halo_form_notes" Multiplicity="*" />

Notice how it replaces Halo2Model.Store. with Self.? We've both checked out the same code.

Another example, where it rearranges the order of parameters:

<Property Name="id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />

becomes

<Property Name="id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />

To me this all looks like somehow we're using a different version of the edmx generator, but I'm struggling to find the documentation that would help explain it. I haven't verified yet, but was wondering if these xml files being out of sync could be the issue? How could these xml files get out of sync, and how do we prevent that from happening?

  • Visual Studio 2012 Ultimate, Update 4
  • v4 .NET Framework
  • All on the EF 6.x EntityObject Generator for C# v 1.0.1.0 Extension

Developer 1:

  • System.Data.Entity.xml, Last Modified: 1/10/2010 9:09pm
  • System.Data.xml, 1/10/20120 9:09pm

Developer 2:

  • System.Data.Entity.xml, Last Modified: 12/12/2011 10:55AM
  • System.Data.xml, 6/15/2012 2:01pm

UPDATE: Tried overwriting my xml files with those from a team member, and that did not solve the issue with the edmx generation.

解决方案

Turns out I had installed the latest version of the Entity Framework 6.1.1 Tools for Visual Studio 2012, described as the first step to get Entity Framework here: http://msdn.microsoft.com/en-US/data/ee712906

Although I couldn't figure out the version history for the tools themselves, once we upgraded the whole team to that version, we stopped having issues.

这篇关于实体框架edmx文件在团队中重新生成不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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