转换asp 到asp.net,在asp.net中大量调用用VB6编写的activeX module,activeX 里调用了其他activeX module。
现在每天有十几个object Variable not set error,而且错误在VB6 module里抓不到,aspx 页面里无法用catch 抓到,直接在页面出错,
该错误难以重现,查日志文件发现一些调用 createobject 行出错,这些行大部分时间都正常,偶尔出错,
不知什么原因,请建议, 痛苦中,我转换老板的代码啊,他的代码草草写成,有苦说不出,谢谢指点

解决方案 »

  1.   

    COM组件默认的线程模型不一样,ASP是单线程模型,ASPNET是多线程模型,如果你的COM是单线程模型,那么在ASPNET中就可能出错
      

  2.   

    同意4 楼的说法  asp 和asp.net 区别还是很明显的
      

  3.   

     更多细节;
    [Exception type] = System.Runtime.InteropServices.COMException[Source] = HP1PlanLister[StackTrace] =    at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
       at PlanList.Page_Load(Object sender, EventArgs e) in PlanList.aspx.vb:line 143[Message] = Object variable or With block variable not set
      

  4.   

    错误在VB6 module里抓不到的原因,logger 是全局变量,在某些sub里被设成nothing,有时出错时logger是nothing所以无法纪录错误,建议logger应是全局静态变量,不应该有用户实例化或设成nothing,