zoukankan      html  css  js  c++  java
  • 遇到一个麻烦的事情,各位给个建议,谢谢了。

    今天翻了翻以前写的一些作品,有个音乐播放器,直接运行了下,感觉没啥问题,但是后来拷贝到同学机子去,问题就出现了。

    上面是在本机运行,一切良好。

    下面是同学机子运行结果:

    可以看到,程序是能够启动的,关键是只要一打开音乐文件,就弹出“未将对象的引用设置到实例",

    以下是相关的错误文本:

    v有关调用实时(JIT)调试而不是此对话框的详细信息,
    请参见此消息的结尾。
    
    ************** 异常文本 **************
    System.NullReferenceException: 未将对象引用设置到对象的实例。
       在 NewPlayer.NewCoreForm.GetMusics(String listName) 位置 G:\Love_Me\软件设计源\多媒体技术\音乐播放器\如林播放器2.0源码版\如林播放器2.0源码版\NewPlayer\NewCoreForm.cs:行号 112
       在 NewPlayer.NewCoreForm.RefreshMusic(String listName) 位置 G:\Love_Me\软件设计源\多媒体技术\音乐播放器\如林播放器2.0源码版\如林播放器2.0源码版\NewPlayer\NewCoreForm.cs:行号 38
       在 NewPlayer.NewCoreForm.OpenMusic(String listName) 位置 G:\Love_Me\软件设计源\多媒体技术\音乐播放器\如林播放器2.0源码版\如林播放器2.0源码版\NewPlayer\NewCoreForm.cs:行号 214
       在 NewPlayer.Player.ToolStripMenuItem_Musics_Click(Object sender, EventArgs e) 位置 G:\Love_Me\软件设计源\多媒体技术\音乐播放器\如林播放器2.0源码版\如林播放器2.0源码版\NewPlayer\Player.cs:行号 710
       在 NewPlayer.Player.ToolStripMenuItem_OpenFileDir_Click(Object sender, EventArgs e) 位置 G:\Love_Me\软件设计源\多媒体技术\音乐播放器\如林播放器2.0源码版\如林播放器2.0源码版\NewPlayer\Player.cs:行号 815
       在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
       在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
       在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
       在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
       在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
       在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
       在 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
       在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
       在 System.Windows.Forms.ToolStripDropDown.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.4984 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    NewPlayer
        程序集版本: 2.0.0.0
        Win32 版本: 1.0.0.0
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/NewPlayer.exe
    ----------------------------------------
    System.Windows.Forms
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4986 (win7RTMGDR.050727-4900)
        基本代码: 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.4985 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4985 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    DevComponents.DotNetBar2
        程序集版本: 10.1.0.3
        Win32 版本: 10.1.0.3
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/DevComponents.DotNetBar2.DLL
    ----------------------------------------
    Accessibility
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    Interop.WMPLib
        程序集版本: 1.0.0.0
        Win32 版本: 1.0.0.0
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/Interop.WMPLib.DLL
    ----------------------------------------
    TrackBarEx
        程序集版本: 1.0.3680.26821
        Win32 版本: 1.0.0.0
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/TrackBarEx.DLL
    ----------------------------------------
    ListViewEx
        程序集版本: 1.3.0.0
        Win32 版本: 1.3.0.0
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/ListViewEx.DLL
    ----------------------------------------
    Interop.Shell32
        程序集版本: 1.0.0.0
        Win32 版本: 1.0.0.0
        基本代码: file:///C:/Users/cg/Desktop/如林播放器2.0源码版/如林播放器2.0源码版/NewPlayer/bin/Debug/Interop.Shell32.DLL
    ----------------------------------------
    mscorlib.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4984 (win7RTMGDR.050727-4900)
        基本代码: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    System.Windows.Forms.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
    ----------------------------------------
    System.Xml
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.4927 (NetFXspW7.050727-4900)
        基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    
    ************** JIT 调试 **************
    要启用实时(JIT)调试,
    该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
    jitDebugging 值。
    编译应用程序时还必须启用
    调试。
    
    例如: 
    
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    
    启用 JIT 调试后,任何无法处理的异常
    都将被发送到在此计算机上注册的 JIT 调试器,
    而不是由此对话框处理。
    

     我就奇怪了,如果真是没有实例化那么我电脑上也应该报错啊,为啥我的电脑运行一切挺好的。

  • 相关阅读:
    pipelinewise 学习二 创建一个简单的pipeline
    pipelinewise 学习一 docker方式安装
    Supercharging your ETL with Airflow and Singer
    ubuntu中使用 alien安装rpm包
    PipelineWise illustrates the power of Singer
    pipelinewise 基于singer 指南的的数据pipeline 工具
    关于singer elt 的几篇很不错的文章
    npkill 一个方便的npm 包清理工具
    kuma docker-compose 环境试用
    kuma 学习四 策略
  • 原文地址:https://www.cnblogs.com/RookieBen/p/3071909.html
Copyright © 2011-2022 走看看