EF Power Tools Beta 2 - 被调用的目标抛出异常 [英] EF Power Tools Beta 2 - exception has been thrown by the target of an invocation
问题描述
这是我的工作: / p>
将构造函数注释出来,并保留静态MyDbContext - >
public class MyDbContext:DbContext
{
public static string ConnectionName =Name = SMS_ADvTECHContext;
static MyDbContext()
{
Database.SetInitializer< SMS_ADvTECHContext>(null);
}
/ * public SMS_MyDbContext()
:base(ConnectionName)
{
} * /
}
然后如果你右键单击上下文类 - > Enityframework - >查看实体数据模型(只读)它生成视图!
I have EF 5.0 code-first VS 2012 project and all Entity Framework menu commands (View Entity Data Model DDL SQL) produce "Exception has been thrown by the target of an invocation" popup. I think what has also changed is that EF Power Tools Beta 1 (or VS 2010, I am not sure) use to display EF Power Tools messages in the output window. Now all I get is the popup... Is this VS or Power Tools issue?
this is my work around:
Comment the constructor out, and leave the static MyDbContext as is -->
public class MyDbContext: DbContext
{
public static string ConnectionName = "Name = SMS_ADvTECHContext";
static MyDbContext()
{
Database.SetInitializer<SMS_ADvTECHContext>(null);
}
/* public SMS_MyDbContext()
: base(ConnectionName)
{
}*/
}
Then if you right click the context class --> Enityframework --> View Entity Data Model (read-only) it generate the view!
这篇关于EF Power Tools Beta 2 - 被调用的目标抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!