This Visual Studio 2010 RC bug is really causing grief. If you see the error message above, check your EDMX file. Visual Studio may have kindly inserted an extra

StoreGeneratedPattern="Identity"

into your EDMX file on a child table for the association back to the parent table.

For example, this …

        <EntityType Name="ExceptionRecordData">
          <Key>
            <PropertyRef Name="ExceptionDataUID" />
          </Key>
          <Property Name="ExceptionDataUID" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="ExceptionUID" Type="bigint" Nullable="false" />
          <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="32" />
          <Property Name="Value" Type="nvarchar" Nullable="false" MaxLength="128" />
        </EntityType>

becomes this … after a simple Update operation

        <EntityType Name="ExceptionRecordData">
          <Key>
            <PropertyRef Name="ExceptionDataUID" />
          </Key>
          <Property Name="ExceptionDataUID" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="ExceptionUID" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="32" />
          <Property Name="Value" Type="nvarchar" Nullable="false" MaxLength="128" />
        </EntityType>

Note how it has added an extra StoreGeneratedPattern=”Identity” on the ExceptionUID property. I hope this gets fixed soon.

If you experience this problem, here’s the link to up-vote it:- https://connect.microsoft.com/data/feedback/details/540058

Update: Microsoft has confirmed that this will be fixed in the released version of Visual Studio 2010 – see comments. Thanks!