I've created console application. Then I've performed Install-Package EntityFramework, setted target .net 4.0.
My simple model is
public class Abonent
{
public Abonent() {}
[Key]
public int AbonentId { get; set; }
public string Name { get; set; }
}
My dbcontext is (ModelContext.cs)
public class ModelContext : DbContext
{
public ModelContext():base(){}
public DbSet<Abonent> Abonents { get; set; }
}
Program.cs is
class Program
{
static void Main(string[] args)
{
Database.DefaultConnectionFactory = new System.Data.Entity.Infrastructure.SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
ModelContext _abonentContext = new ModelContext();
Abonent abonent=new Abonent();
_abonentContext.Abonents.Add(abonent);
_abonentContext.SaveChanges();
}
}
It works just fine, but when I do right button click on ModelContext.cs and choose Entity Framework -> Generate View and I get a message box saying "Exception has been thrown by the target of an invocation".
What I've done wrong? Is exist alternative for ef power tools? (VS 2010 SP1,Entity Framework Power Tools Beta 2)