0

インストールせずにMVC 3で使用するSqlServer CE 4.0の感触を得ています。順調に進んでいます。Troy Goode のMembershipStarterKitと ErikEJ のSqlServerCEMembershipプロバイダーをうまく統合しました。両方とも機能しています。今、私はモダークラスを持っています:

public class Student
{
    [Key]
    public int Id{get;set;}
    [Required]
    public string FirstName{get;set;}
    [Required]
    public string LastName{get;set;}
    [Required]
    public DateTime DOB{get;set;}
    [Required]
    public string Gender{get;set;}
}

DBContextクラスも使用しています:

public class MyDbContext: DBContext
{
    public DbSet<Student> Students{get;set;}
}

クラスをモデルとして選択してコントローラーを追加しようとするとStudent、次のエラーが発生します。

Unable to retrieve metadata for 'MVCProject1.Models.Student'. There was an error 
generating 'ScaffoldingConnectionFactory. Try Rebuilding your project.

パッケージ EntityFrameWork.SqlServerCompact の 4.3.0 と 4.3.2 の両方のバージョンを試しましたが、まだエラーが発生します。私のアプローチの何が問題になっていますか?

編集:-パッケージをアンインストール/再インストールして、プロジェクトを再構築した後、何度も試しました。

4

1 に答える 1