Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception error + wont detect WMP when run as administrator #5

Open
Hrobo776 opened this issue Dec 17, 2023 · 16 comments
Open

Comments

@Hrobo776
Copy link

Whenever I run the exe file, it detects the WMP and the song/music its playing, however, it throws an unhandled exception error right after it loads up.
image

I decided to run the exe as administrator hoping it would work, it loads just fine, however, it doesnt detect WMP and just says "Stopped". Console reads: "error trying to read WMP data, retrying", followed by another line saying "aborting", repeating every second
image

@T0biasCZe
Copy link
Owner

What does it show in the details inside the unhandled exception error?

@T0biasCZe
Copy link
Owner

And it doesn't work when run as admin, since when running as admin it can't read the data from WMP that's running as user

@Hrobo776
Copy link
Author

This is what it says exactly

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 Discord_WMP.Form1.update_Tick(Object sender, EventArgs e) in C:\Users\tobik\Source\Repos\T0biasCZe\Windows-Media-Player-Discord-RPC\Discord WMP\Form1.cs:line 301
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.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.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Discord WMP
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/DRP4WMP/Discord%20WMP.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_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.9206.0 built by: NET481REL1LAST_B
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.9037.0 built by: NET481REL1
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.9037.0 built by: NET481REL1
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.9200.0 built by: NET481REL1LAST_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.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

Interop.WMPLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/DRP4WMP/Interop.WMPLib.DLL

CsvHelper
Assembly Version: 30.0.0.0
Win32 Version: 30.0.1.0
CodeBase: file:///E:/DRP4WMP/CsvHelper.DLL

Microsoft.Bcl.AsyncInterfaces
Assembly Version: 1.0.0.0
Win32 Version: 4.700.19.46214
CodeBase: file:///E:/DRP4WMP/Microsoft.Bcl.AsyncInterfaces.DLL

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

Microsoft.Bcl.HashCode
Assembly Version: 1.0.0.0
Win32 Version: 4.700.19.46214
CodeBase: file:///E:/DRP4WMP/Microsoft.Bcl.HashCode.DLL

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

DiscordRPC
Assembly Version: 1.2.1.24
Win32 Version: 1.2.1.24
CodeBase: file:///E:/DRP4WMP/DiscordRPC.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.

@Hrobo776
Copy link
Author

I updated the program but it still wouldnt open, still throwing the same Unhandled exception error as seen in the first image

@T0biasCZe
Copy link
Owner

hmm do you have discord installed and running? since in the error it mentions line 301, on which the discord rich presence is being set. and it may throw error
(if you do not want to use discord there is checkbox in settings to disable the discord functionality)

@keroblin
Copy link

Also having this error, runs fine with Discord and Windows Media Player closed, but then immediately throws errors when Discord is opened

@keroblin
Copy link

this is my error message

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 Discord_WMP.Form1.update_Tick(Object sender, EventArgs e) in C:\Users\tobik\Source\Repos\T0biasCZe\Windows-Media-Player-Discord-RPC\Discord WMP\Form1.cs:line 307
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.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.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Discord WMP
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Programs/Discord%20WMP/Discord%20WMP.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_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.9214.0 built by: NET481REL1LAST_B
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.9032.0 built by: NET481REL1
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.9032.0 built by: NET481REL1
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.9214.0 built by: NET481REL1LAST_B
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.9032.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Interop.WMPLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Programs/Discord%20WMP/Interop.WMPLib.DLL

Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

CsvHelper
Assembly Version: 30.0.0.0
Win32 Version: 30.0.1.0
CodeBase: file:///D:/Programs/Discord%20WMP/CsvHelper.DLL

Microsoft.Bcl.AsyncInterfaces
Assembly Version: 1.0.0.0
Win32 Version: 4.700.19.46214
CodeBase: file:///D:/Programs/Discord%20WMP/Microsoft.Bcl.AsyncInterfaces.DLL

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

Microsoft.Bcl.HashCode
Assembly Version: 1.0.0.0
Win32 Version: 4.700.19.46214
CodeBase: file:///D:/Programs/Discord%20WMP/Microsoft.Bcl.HashCode.DLL

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

DiscordRPC
Assembly Version: 1.2.1.24
Win32 Version: 1.2.1.24
CodeBase: file:///D:/Programs/Discord%20WMP/DiscordRPC.DLL

Windows.Media
Assembly Version: 255.255.255.255
Win32 Version: 10.0.10011.16384
CodeBase: file:///C:/WINDOWS/SysNative/WinMetadata/Windows.Media.winmd

System.Runtime
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.dll

Windows.Foundation
Assembly Version: 255.255.255.255
Win32 Version: 10.0.10011.16384
CodeBase: file:///C:/WINDOWS/SysNative/WinMetadata/Windows.Foundation.winmd

System.Runtime.InteropServices.WindowsRuntime
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.InteropServices.WindowsRuntime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.InteropServices.WindowsRuntime.dll

System.Runtime.WindowsRuntime
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.WindowsRuntime/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.WindowsRuntime.dll

Windows.Storage
Assembly Version: 255.255.255.255
Win32 Version: 10.0.10011.16384
CodeBase: file:///C:/WINDOWS/SysNative/WinMetadata/Windows.Storage.winmd

************** 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.

T0biasCZe added a commit that referenced this issue Jan 18, 2024
T0biasCZe added a commit that referenced this issue Jan 18, 2024
@T0biasCZe
Copy link
Owner

T0biasCZe commented Jan 18, 2024

please try this build if it works or if it still throws error
[old file deleted]

@keroblin
Copy link

image
unfortunately this now doesn't ask me about Discord at all and shows these windows. It does not sync with discord either, but there are no errors thrown

@T0biasCZe
Copy link
Owner

I apologize, I accidentally uploaded old zip, this is the file with the potential fix implemented:
Discord WMP.zip

@keroblin
Copy link

Hi again and thanks for all your help,
Unfortunately, while not crashing and now displaying the data correctly in the window, it is not showing in Discord still at this stage. Is there anything more I need to do?

@keroblin
Copy link

Also when I click the taskbar tray icon to open the window and view the data, it will work for a couple of seconds before crashing and closing, unfortunately without an error report
crash discord wmp

@T0biasCZe
Copy link
Owner

T0biasCZe commented Jan 20, 2024

try inserting "1076519967631093891" into the empty textbox at the top (without the quotes)

@keroblin
Copy link

Unfortunately this doesn't do anything
When I click the settings button the app still crashes after a few seconds and it doesn't link to my Discord

@keroblin
Copy link

crash discord wmp 2

@T0biasCZe
Copy link
Owner

T0biasCZe commented Jan 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants