且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实体框架edmx文件在团队中重新生成不同

更新时间:2023-02-04 10:53:16

事实证明,我已经安装了最新版本的实体框架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.