Unhandled Exception Error

Post Reply
ManOfTime
Posts: 3
Joined: 13 Oct 2020, 11:23

Unhandled Exception Error

Post by ManOfTime »

Hi all! I am getting an 'Unhandled exception error' when running MidiKey2Key, but only sometimes.

When I trigger the app to run either on Windows startup, or using task scheduler to have it open on system unlock, it throws the error.

When I start the app manually, it usually works at least on the second try. Any help would be much appreciated.
ManOfTime
Posts: 3
Joined: 13 Oct 2020, 11:23

Here is the error

Post by ManOfTime »

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 PureMidi.Monitor.Monitor.checkBoxLogToWindow_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.set_Checked(Boolean value)
at PureMidi.Monitor.Monitor.StartUpSequence2()
at PureMidi.Monitor.Monitor.Monitor_Shown(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnShown(EventArgs e)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4220.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
MidiKey2Key
Assembly Version: 2.3.7517.30124
Win32 Version: 2.3.5.0
CodeBase: file:///C:/Program%20Files/MidiKey2Key/MidiKey2Key.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4200.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4200.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4220.0 built by: NET48REL1LAST_C
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.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.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.
User avatar
Der Abt
Site Admin
Posts: 90
Joined: 14 Aug 2020, 09:30
Location: Fulda, Germany
Contact:

Re: Unhandled Exception Error

Post by Der Abt »

Other users reported such execption errorswhen launching MK2K too soon after windows start.
I think it is when the windows multimedia system is not completely loaded.

It definitely throws this exception, when Your MIDI port is already in use by another program.
Greetz
Der Abt

Creator of MidiKey2Key
https://midikey2key.de
ManOfTime
Posts: 3
Joined: 13 Oct 2020, 11:23

Re: Unhandled Exception Error

Post by ManOfTime »

Thank you, I'll try out delaying the start and hunting for anything that may be using the midi port before it launches.
rwilliam99
Posts: 2
Joined: 23 Jan 2022, 22:39

Re: Unhandled Exception Error

Post by rwilliam99 »

I also have this issue. I've tried delaying the startup of the app but it is inconsistent. Some times, it loads at boot, sometimes it throws the error. Sometimes it will throw the error when attempting to start it manually. I've created scripts to try and load it if it fails, but those almost never seem to successfully load it.

Does anyone have any ideas or suggestions on how to determine exactly what is causing it to fail to start? I've been using it for almost a year, and this failure to start appears to have started a few months ago - I'm guessing due to some windows update. Are there logging changes or something to determine exactly what the cause is?

Thanks
rwilliam99
Posts: 2
Joined: 23 Jan 2022, 22:39

Re: Unhandled Exception Error

Post by rwilliam99 »

Since this forum appears dead (it has been almost two weeks since I posted this with no response), I thought I would post how I resolved this issue. I ended up going with another solution - Bome MIDI Translator Pro - it is a paid solution, however it also provided some additional parameters to improve the usefulness of how I was using it. Specifically the ability to introduce delays in processing the events, which smoothed out how it was working for me.
User avatar
Der Abt
Site Admin
Posts: 90
Joined: 14 Aug 2020, 09:30
Location: Fulda, Germany
Contact:

Re: Unhandled Exception Error

Post by Der Abt »

Hey @rwilliams99, I am sorry to read about Your issue.
I do not have this problem, so it is hard to fid the cause.
Scripting abilities, and sequencing with timing and pauses is an upcoming feature.
Greetz
Der Abt

Creator of MidiKey2Key
https://midikey2key.de
Post Reply