使用EF Power Tools 错误参数 80070057解决方法

错误参数。(异常来自 HRESULT:0x80070057 (E_INVALIDARG))

An error occurred while trying to instantiate the dbcontext type TestDB2Context see the output window for details

 

public class ProductContext : DbContext
 {
        public ProductContext()
            : base(@"Data Source=.;Initial Catalog=Product;Integrated Security=True")
        { }
  static ProductContext()
  { 
   Database.SetInitializer<ProductContext>(null);
  }

  public DbSet<Category> Categories { get; set; }
  public DbSet<Product> Products { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
            modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
   modelBuilder.Configurations.Add(new CategoryMap());
   modelBuilder.Configurations.Add(new ProductMap());
  }

 并且config文件中的仍然保留!

你可能感兴趣的:(tools)