呈现该控件时出错。

“Lephone.Data.DbEntry”的类型初始值设定项引发异常。


在设计时出现,,编译与运行时程序正常,,,,没有这个GridView字段列就不能自动生成,工作量会增加好多,

大家有没有遇到这个问题,,我现在不知道是dbEntry3.9的问题,还是我的VS2008的问题,用dbentry3.5时正常,,,,


//////////修正方法

ObjectInfo_ctor.cs中加个try catch ,不让设计时初始化对象的数据访问上下文抛出异常。




internal void InitContext()         {             try             {                 var attr = ClassHelper.GetAttribute<DbContextAttribute>(_baseType, true);                 _context = DbEntry.GetContext(attr == null ? null : attr.ContextName);             }             catch (Exception )             {          //       throw ex;             }          }