首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

we7 本地运行 引发类型为“Thinkment.Data.DataException”的错误

2012-05-28 
we7 本地运行 引发类型为“Thinkment.Data.DataException”的异常。引发类型为“Thinkment.Data.DataException

we7 本地运行 引发类型为“Thinkment.Data.DataException”的异常。
引发类型为“Thinkment.Data.DataException”的异常。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: Thinkment.Data.DataException: 引发类型为“Thinkment.Data.DataException”的异常。

源错误:

行 76: , ex.ErrorCode, ex.Message);
行 77: We7.Framework.LogHelper.WriteLog(typeof(ApplicationHelper), msg);
行 78: throw ex;
行 79: }
行 80: 
源文件: F:\web7\We7.CMS.Install\ApplicationHelper.cs 行: 78 

错误源
 public void Build()
  {
  //typeName=WebEngine2007.AD.Common.AdZone, WebEngine2007.AD.Common
  objType = System.Type.GetType(typeName);
  if (objType == null)
  {
  throw new DataException(ErrorCodes.UnkownObject);
  }
  foreach (PropertyInfo pi in objType.GetProperties())
  {
  if (propertyDict.ContainsKey(pi.Name))
  {
  Property p = propertyDict[pi.Name];
  p.Info = pi;
  }
  }
  foreach (Property p in propertyDict.Values)
  {
  if (p.Info == null)
  {
  string s = String.Format("{0}.{1}", ObjType.ToString(), p.Name);
  //throw new DataException(s, ErrorCodes.UnknownProperty);
  }
  }
  }
Ad.xml
<?xml version="1.0" encoding="utf-8" ?>
<Objects>
  <Database name="WebEngine2007.AD.Common" driver="Thinkment.Data.SqlDbDriver" connectionString="Server=.;Database=ad;User=sa;Password=yyaccp">
  <!--<Database name="WebEngine2007.AD.Common" driver="Thinkment.Data.OleDbDriver" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source{$Current}\AD.mdb">-->
  <Object type="WebEngine2007.AD.Common.AdZone, WebEngine2007.AD.Common" table="AdZone" primaryKey="ID" identity="">
  <Property name="ID" field="ID" size="40" type="String" nullable="false" />
  <Property name="ZoneName" field="ZoneName" size="100" type="String"/>
  <Property name="ZoneIntro" field="ZoneIntro" size="255" type="String" />
  <Property name="ZoneType" field="ZoneType" size="4" type="Int32" />
  <Property name="DefaultSetting" field="DefaultSetting" size="4" type="Int32"/>
  <Property name="ZoneSetting" field="ZoneSetting" size="65536" type="String"/>
  <Property name="ZoneWidth" field="ZoneWidth" size="4" type="Int32" />
  <Property name="ZoneHeight" field="ZoneHeight" size="4" type="Int32" />
  <Property name="Active" field="Active" size="4" type="Int32"/>
  <Property name="ShowType" field="ShowType" size="4" type="Int32" />
  <Property name="Created" field="Created" size="4" type="DateTime" />
  <Property name="Updated" field="Updated" size="4" type="DateTime" />


  <Property name="EnumState" field="EnumState" size="50" type="String"/>
  <Property name="SiteID" field="SiteID" size="50" type="String" />
  </Object>

本地跑这个地方要怎么修改吗???

[解决办法]
这个问题的解决其实很简单,我昨天调试代码的时候遇到这个问题。
解决办法是:We7.CMS.Web\App_Data\XML文件夹下有个AD.XML文件,删除了。
只留一个CD.XML文件。
问题的原因:在We7.Share\Thinkment.Data这个目录下的Internal.cs文件里面679行的objType = System.Type.GetType(typeName);这边取不到类型。

热点排行