title: System.Data.Entity.Edm.EdmEntityType has no key defined
body: <p>I am trying to create an sdf with Code-First, however I am getting an error that no Keys are defined for my tables, and cannot understand why.</p>
  
  <p>I have the following Classes :-</p>
  
  <pre><code>public class Article
  {
      [Key]
      public int ArticleID;
  
      //[Display(Name = "Title")]
      //[MaxLength(255)]
      //[Required(ErrorMessage="Title is required")]
      public string ArticleTitle;
  
      //[Display(Name = "Date")]
      //[DisplayFormat(DataFormatString = "{0:#.#}", ApplyFormatInEditMode = true, NullDisplayText = "")]
      //[Required(ErrorMessage = "Date is required")]
      public DateTime ArticleDate;
  
      //[Display(Name = "Text")]
      //[Required(ErrorMessage = "Text is required")]
      public string ArticleText;
  
      //[Display(Name = "Source")]
      public string ArticleSource;
  
      //[Display(Name = "Category")]
      public int CategoryID { get; set; }
  
      public virtual Category Category { get; set; }
  
  }
  
  public class Category
  {
      [Key]
      public int CategoryID;
  
      [Display(Name = "Category Title")]
      [MaxLength(255)]
      [Required(ErrorMessage = "Category Title is required")]
      public string CategoryTitle;
  
  }
  
  public class CommonsContext : DbContext
  {
      public DbSet&lt;Article&gt; Articles { get; set; }
      public DbSet&lt;Category&gt; Categories { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
  
          //A one-to-one relationship between the Article and Category tables. 
          modelBuilder.Entity&lt;Article&gt;().HasRequired(x =&gt; x.Category);
      }
  
  }
  </code></pre>
  
  <p>and in the web.config :-</p>
  
  <pre><code>&lt;add name="CommonsContext" connectionString="Data Source=|DataDirectory|Personal.sdf" providerName="System.Data.SqlServerCe.4.0" /&gt;
  </code></pre>
  
  <p>When I browse to the App_Data folder, I cannot even see the Personal.sdf, so it means that its not even created.</p>
  
  <p>What am I doing wrong?  Can't figure out as yet.</p>
  
  <p>Thanks for your help and time</p>