#6 object not set to an insance of an object error

v0.2.13
closed-fixed
None
5
2014-09-24
2013-08-28
No

Following error is received when using any of the project menus. Similar errors when using the other menus.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

** Exception Text **
System.NullReferenceException: Object reference not set to an instance of an object.
at Dile.UI.MainForm.projectMenu_Popup(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnPopup(EventArgs e)
at System.Windows.Forms.Menu.ProcessInitMenuPopup(IntPtr handle)
at System.Windows.Forms.Form.WmInitMenuPopup(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies **
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Dile
Assembly Version: 0.2.12.3333
Win32 Version: 0.2.12.3333
CodeBase: file:///C:/Users/Paul/Downloads/dile/Dile.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0
b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0b77a5c561934e089/System.dll
----------------------------------------
WeifenLuo.WinFormsUI.Docking
Assembly Version: 2.3.1.24483
Win32 Version: 2.3.1.0
CodeBase: file:///C:/Users/Paul/Downloads/dile/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
Dile.Debug
Assembly Version: 0.2.12.3333
Win32 Version:
CodeBase: file:///C:/Users/Paul/Downloads/dile/Dile.Debug.DLL
----------------------------------------
System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0
b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0
b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------

** JIT Debugging **
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true"/>
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Related

Bugs: #6

Discussion

  • Paul Hatchman

    Paul Hatchman - 2013-08-28

    Issue appears to be that the HandleCreated delgate which is set in the MainForm constructor is never called.

    Adding the code MainForm_HandleCreated(null,null); to the MainForm constructor appears to resolve the issue. But will test further.

     
    Last edit: Paul Hatchman 2013-08-28
  • Petrény Zsolt

    Petrény Zsolt - 2013-08-29

    Hi Paul,

    Thanks a lot for reporting this issue. I'll take a look at it over the weekend and let you know what I found.

    Regards,
    Zsolt Petreny

     
  • Petrény Zsolt

    Petrény Zsolt - 2013-08-29
    • assigned_to: Petrény Zsolt
     
  • Petrény Zsolt

    Petrény Zsolt - 2013-08-31

    Hi Paul,

    I have taken a look at the code and I don't really understand why it's not working for you. Is there anything unusual about your environment? Are you running DILE on Windows 8 or .NET 4.5 or something similar? And are you having this issue with the version that you downloaded from Sourceforge or with the one you built yourself from the source code?

    I've searched on the internet but I couldn't find any relevant issue with the HandleCreated event and this piece of code hasn't failed me for several years. So I find it a bit strange that suddenly it doesn't work for somebody else.

    Anyway, since fixing this issue is quite easy the way you suggested, I'll change the code for the next release. I would just like to know why DILE behaves differently on your machine...

    Regards,
    Zsolt Petreny

     
  • Paul Hatchman

    Paul Hatchman - 2013-09-02

    Hi Zsolt,

    I'm running on Windows 7. It looks from the assemblies loaded, that this is
    on Framework 4.0?

    It was happening both on the downloaded version and also the version I
    built from source. Though I built it in Visual Studio 2012 and had to
    change a few paths in the project to get it to build since you were using
    the SDK.

    Sadly, I haven't written any code in about 5 years now, so I'm not really
    up to speed with the latest .Net, but I'll play with it later to see if I
    can recreate the same behaviour in another project.

    I ended up using Telerik and the Reflexil plugin in the end since it's a
    mixed-mode application, which I assume was stopping Dile from loading the
    .exe

    Thanks,

    Paul

    On 31 August 2013 19:18, "Petrény Zsolt" zsozsop@users.sf.net wrote:

    Hi Paul,

    I have taken a look at the code and I don't really understand why it's not
    working for you. Is there anything unusual about your environment? Are you
    running DILE on Windows 8 or .NET 4.5 or something similar? And are you
    having this issue with the version that you downloaded from Sourceforge or
    with the one you built yourself from the source code?

    I've searched on the internet but I couldn't find any relevant issue with
    the HandleCreated event and this piece of code hasn't failed me for several
    years. So I find it a bit strange that suddenly it doesn't work for
    somebody else.

    Anyway, since fixing this issue is quite easy the way you suggested, I'll
    change the code for the next release. I would just like to know why DILE
    behaves differently on your machine...

    Regards,
    Zsolt Petreny


    Status: open
    Created: Wed Aug 28, 2013 02:34 PM UTC by Paul Hatchman
    Last Updated: Thu Aug 29, 2013 12:22 PM UTC
    Owner: Petrény Zsolt

    Following error is received when using any of the project menus. Similar
    errors when using the other menus.

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    *** Exception Text ***
    System.NullReferenceException: Object reference not set to an instance of
    an object.
    at Dile.UI.MainForm.projectMenu_Popup(Object sender, EventArgs e)
    at System.Windows.Forms.MenuItem.OnPopup(EventArgs e)
    at System.Windows.Forms.Menu.ProcessInitMenuPopup(IntPtr handle)
    at System.Windows.Forms.Form.WmInitMenuPopup(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
    IntPtr wparam, IntPtr lparam)

    *** Loaded Assemblies
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Dile
    Assembly Version: 0.2.12.3333
    Win32 Version: 0.2.12.3333
    CodeBase: file:///C:/Users/Paul/Downloads/dile/Dile.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0
    b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0
    b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0

    b77a5c561934e089/System.dll
    ----------------------------------------
    WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.3.1.24483
    Win32 Version: 2.3.1.0
    CodeBase:
    file:///C:/Users/Paul/Downloads/dile/WeifenLuo.WinFormsUI.Docking.DLL
    ----------------------------------------
    Dile.Debug
    Assembly Version: 0.2.12.3333
    Win32 Version:
    CodeBase: file:///C:/Users/Paul/Downloads/dile/Dile.Debug.DLL
    ----------------------------------------
    System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0
    b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------
    System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0
    b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0
    *b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase:
    file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------

    *** JIT Debugging ***
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/dile/bugs/6/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #6

  • Petrény Zsolt

    Petrény Zsolt - 2013-09-03

    Hi Paul,

    I'll really change the code for the next release just to be safe. Anyway, I'm not really sure why I created that event handler in the first place. Maybe it had something to do with an old version of the docking controls I use. Moving the code of the event handler to the constructor seems to work fine though and apparently fixes your issue so it makes sense doing it.

    Anyway, thank you very much for reporting this issue and even providing a solution for it. :)

    By mixed-mode applications I suppose you mean native apps which host the .NET Framework (like Windows Explore, Outlook and Visual Studio) or IJW (It Just Works) assemblies which contain both managed and unmanaged C++ code. I believe DILE should be able to handle both situations. For example, the Dile.Debug.dll is such an IJW assembly and DILE has no problem with opening it or debugging itself. And you can also debug Visual Studio using DILE despite that it's an unmanaged app which just hosts the .NET Framework. Actually it's quite fun putting a breakpoint in the constructor of the Form class, then opening a form in Visual Studio and looking around to see what VS really does to display the form designer. :) But I also used DILE in the past for debugging crashes in VS add-ins.

    The only issue I know about is that DILE doesn't seem to be able to debug processes which host more than 1 version of the .NET Framework. For example, if you have 2 shell add-ins where one requires .NET 2.0 and the other requires 4.0 then Windows Explorer is able to load both versions of the .NET Framework. DILE can show in the Attach to process... dialog that Windows Explorer hosts 2 different versions of the .NET Framework but it won't be able to attach to it. This is an issue I haven't really looked into much as it doesn't seem to be a common scenario but maybe I should really fix it.

    Anyway, thanks once again for taking the time to help out with DILE. :)

    Regards,
    Zsolt Petreny

     
  • Petrény Zsolt

    Petrény Zsolt - 2014-02-23
    • status: open --> accepted
    • Group: v0.01 --> v0.2.13
     
  • Petrény Zsolt

    Petrény Zsolt - 2014-09-24
    • status: accepted --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks