实体框架Power Tools在生成视图时出现问题

Fun*_*ype 1 entity-framework ef-code-first

我已经创建了控制台应用程序.然后我执行了Install-Package EntityFramework,设置了目标.net 4.0.

我的简单模型是

public class Abonent
    {
        public Abonent() {}
        [Key]
        public int AbonentId { get; set; }
        public string Name { get; set; }
    }
Run Code Online (Sandbox Code Playgroud)

我的dbcontext是(ModelContext.cs)

public class ModelContext : DbContext
    {
        public ModelContext():base(){}
        public DbSet<Abonent> Abonents { get; set; }
    }
Run Code Online (Sandbox Code Playgroud)

Program.cs是

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();
        }
    }
Run Code Online (Sandbox Code Playgroud)

它工作得很好,但是当我按下右键单击ModelContext.cs并选择时Entity Framework -> Generate View,我会得到一个消息框,说"调用目标已抛出异常".

我做错了什么?是否存在ef电动工具的替代品?(VS 2010 SP1,实体框架Power Tools Beta 2)

Ela*_*son 5

我有这个问题,并通过从工具 - >扩展和更新菜单中卸载实体框架电源工具Beta 2来解决它.

然后我重新启动所有visual studio 2012实例并通过相同的菜单选项重新安装它.

这解决了我的问题.

祝好运.