使用EF Power Tools 错误参数 80070057解决方法
2012-07-06 10:45
330 查看
错误参数。(异常来自 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文件中的仍然保留!
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文件中的仍然保留!
相关文章推荐
- 使用EF Power Tools生成映射关系时候 参数错误 :0x80070057
- EF Power Tool 参数错误 HRESULT:0x80070057 (E_INVALIDARG)) 解决办法
- EF Power Tools参数不正确的解决方法
- EF Power Tools参数不正确的解决方法
- EF Power Tools 参数错误 HRESULT:0x80070057 (E_INVALIDARG))
- 使用 Entity Framework Power Tool 报错 0×80070057 解决方法
- Visual Studio 2012 update1 更新导致 EF Power Tools 反向工程错误的解决办法
- EF Power Tools Beta 2 生成 Entity Framework Code First 提示 参数错误 hresult e_invalidarg
- Entity Framework Power Tools使用提示参数错误
- EF(Entity Framework)发生错误”正在创建模型,此时不可使用上下文“的解决办法。 正在创建模型,此时不可使用上下文。如果在 OnModelCreating 方法内使用上下文或如果多个线程同时访问同一上下文实例,可能引发此异常。请注意不保证 DbContext 的实例成员和相关类是线程安全的。 临时解决了这个问题,在Context的构造函数中,禁用了自动初始化:
- EF Power Tools Beta 2 生成 Entity Framework Code First 提示 参数错误 hresult e_invalidarg
- 关于使用DataTable.Compute()方法时报“聚合参数中的语法错误: 需要具有可能的“Child”限定符的单个列参数。”
- 在android中使用proguard混淆代码出现“Conversion to Dalvik format failed with error 1”错误的解决方法
- 在应用程序级别之外使用注册为 allowDefinition=’MachineToApplication’ 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误”的解决方法
- xcode4.3 coredata使用时报Code=134100 错误的解决方法
- 【Android学习笔记】如何使用Eclipse在Android项目中调用C/C++代码,及遇到的错误解决方法
- 使用AndroidStudio编译NDK的方法及错误解决方式
- MVC中使用entity framework(EF)出现“必须添加对程序集“System.Data.Entity”解决方法
- ASP.NET AJAX Tookit TabContainer 控件使用常见错误及解决方法
- win7使用arp-d提示参数错误的解决办法。