小弟新手 请大家指教
我用vs2008做的winForm界面,调用一些uesrControl编译的DLL,根据界面上的操作winForm显示相应的uesrControl。整个程序调试、部署都没有问题,但是安装完部署的安装包后运行出错,错误信息如下:
-----------------------------------------------------------------------------------------
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 WFA_ZhuChuangTi.Form_ZuChuangTi.Form1_Load(Object sender, EventArgs e)
   在 System.Windows.Forms.Form.OnLoad(EventArgs e)
   在 System.Windows.Forms.Form.OnCreateControl()
   在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   在 System.Windows.Forms.Control.CreateControl()
   在 System.Windows.Forms.Control.WmShowWindow(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
   在 System.Windows.Forms.Form.WmShowWindow(Message& m)
   在 System.Windows.Forms.Form.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 **************
mscorlib
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1882 (QFEN-1.050727-1800)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CL_MoveDirectory
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/nwpu/.../bin/CL_MoveDirectory.DLL
----------------------------------------
WFCL_JieGouTiaoPin
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/nwpu/.../bin/WFCL_JieGouTiaoPin.DLL
----------------------------------------
WFCL_ZuNiHuan
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/nwpu/.../bin/WFCL_ZuNiHuan.DLL
----------------------------------------
WFCL_ZuNiWan
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/nwpu/.../bin/WFCL_ZuNiWan.DLL
----------------------------------------
WFCL_XiuXing
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/nwpu/.../bin/WFCL_XiuXing.DLL
----------------------------------------
mscorlib.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1882 (QFEN-1.050727-1800)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。例如: <configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。

解决方案 »

  1.   

    空引用啊。查代码
    根据Debug信息
    WFA_ZhuChuangTi.Form_ZuChuangTi.Form1_Load(Object sender, EventArgs e)等一步一步跟下去喽
      

  2.   

    你的安装部署项目有没把这些DLL都添加完整了?
      

  3.   

    uesrControl的DLL肯定是都添加了的,要不程序都不能调试了吧
      

  4.   

    你的安装包里是不是少了那个dll文件没有打包进去啊?
      

  5.   

    dll没有缺少,可能确实是空引用的问题
      

  6.   

    初始数据 null 的吧!
    WFA_ZhuChuangTi.Form_ZuChuangTi.Form1_Load(Object sender, EventArgs e)
    调试一下
      

  7.   

    在你的程序WFA_ZhuChuangTi.Form_ZuChuangTi.Form1_Load处设置断点,一步步跟踪看看也许是你需要的文件没有打包进去,造成错误
      

  8.   

    我的问题已经解决了,应该是null引起的问题,谢谢你们给我提供了思路!