Der Entitätstyp 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin <string>' erfordert die Definition eines Schlüssels

Ich verwende eine ASP.NET5 MVC-Anwendung mit EF7. Bisher funktioniert alles einwandfrei und ich kann Migrationen hinzufügen und Daten in der Datenbank beibehalten. Nachdem ich meinem Datenschichtprojekt Identity hinzugefügt habe, wird beim Versuch, eine neue Migration hinzuzufügen, die folgende Fehlermeldung angezeigt:

Der Entitätstyp 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin' erfordert die Definition eines Schlüssels

Mein Kontext wird von IdentityDbContext abgeleitet:

public class ASSWebApiContext : IdentityDbContext<AppUser>

die AppUser-Klasse:

using Microsoft.AspNet.Identity.EntityFramework;
using System;

namespace ASS.DomainDataModel.Models
{
    public class AppUser : IdentityUser
    {
        public string AppUserId { get; set; }
        public DateTime FirstFlight { get; set; }
    }
}

project.json

{
  "version": "1.0.0-*",
  "description": "ASS.DomainDataModel Class Library",
  "authors": [ "xxxx" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "frameworks": {
    "dnx451": {
      "dependencies": {
      }
    },
    "dnxcore50": {
      "dependencies": {
      }
    }
  },

  "dependencies": {
    "ASS.DomainClasses": "1.0.0-*",
    "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
    "EntityFramework.Core": "7.0.0-rc1-final",
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "EntityFramework.Relational": "7.0.0-rc1-final",
    "System.Linq.Expressions": "4.0.11-beta-23516",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final"
  },

    "commands": {
    "ef": "EntityFramework.Commands"
  }
}

Ich habe hier nur das relevante neue Paket geladen: "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final", die AppUser-Klasse hinzugefügt - sonst nichts. Ich hatte ein ähnliches Projekt mit Beta-8, das genau dasselbe Muster verwendete, bei dem es ohne Probleme funktionierte. Gibt es relevante Änderungen zwischen Beta-8 und RC-1?

Vielen Dank

Below ist Teil des ASSWebApiContext. Für die meisten Entitäten mit einem DbSet gibt es einen modelBuilder.Entity. Also geht die Datei noch eine ganze Weile weiter ...

using Microsoft.Data.Entity;
using ASS.DomainClasses.Entities;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.PlatformAbstractions;
using System.Linq;
using ASS.DomainClasses.Interfaces;
using System;
using Microsoft.AspNet.Identity.EntityFramework;

namespace ASS.DomainDataModel.Models
{
    public class ASSWebApiContext : IdentityDbContext<AppUser>
    {
        public IConfigurationBuilder Config { get; set; }
        public IConfigurationRoot _Configuration { get; private set; }

        public ASSWebApiContext(IApplicationEnvironment appEnv)
        {
            Database.EnsureCreated();

            Config = new ConfigurationBuilder()
                .SetBasePath(appEnv.ApplicationBasePath)
                .AddJsonFile("config.json");

            _Configuration = Config.Build();

        }

        public DbSet<Address> Addresses { get; set; }
        public DbSet<AddressType> AddressTypes { get; set; }
        public DbSet<Aircraft> Aircrafts { get; set; }
        public DbSet<AircraftModel> AircraftModels { get; set; }
        public DbSet<AircraftOwner> AircraftOwners { get; set; }
        public DbSet<AircraftOwnerType> AircraftOwnerTypes { get; set; }
        public DbSet<Country> Countries { get; set; }
        public DbSet<GPEncodingType> GPEncodingTypes { get; set; }
        public DbSet<LocationPoint> LocationPoints { get; set; }
        public DbSet<Manufacturer> Manufacturer { get; set; }
        public DbSet<Pilot> Pilots { get; set; }
        public DbSet<ServiceProvider> ServiceProviders { get; set; }
        public DbSet<State> States { get; set; }
        public DbSet<Trip> Trips { get; set; }
        public DbSet<Stop> Stops { get; set; }
        public DbSet<Track> Tracks { get; set; }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {


            modelBuilder.Entity<AddressType>(
                e =>
                {
                    e.Property(n => n.AddressTypeId).IsRequired().UseSqlServerIdentityColumn();
                    e.Property(n => n.Name).IsRequired().HasMaxLength(15);
                    e.Ignore(n => n.IsDirty);
                });

            modelBuilder.Entity<Address>(
                e =>
                {
                    e.Property(n => n.AddressId).IsRequired().UseSqlServerIdentityColumn();
                    e.Property(n => n.AddressTypeId).IsRequired();
                    e.Property(i => i.CountryId).HasMaxLength(2);
                    e.Property(i => i.AddrLine1).HasMaxLength(256);
                    e.Property(i => i.AddrLine2).HasMaxLength(256);
                    e.Property(i => i.AddrLine3).HasMaxLength(256);
                    e.Property(i => i.Postcode).HasMaxLength(50);
                    e.Ignore(n => n.IsDirty);
                });
...

Antworten auf die Frage(2)

Ihre Antwort auf die Frage