Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
561 stars 93 forks source link

[BUG] Discord RPC doesn't work in UWP default C# applications. #236

Open J0nathan550 opened 1 year ago

J0nathan550 commented 1 year ago

Describe the bug After trying to call client and basic rich presence as showed in example in README the rich presence doesn't appear in Discord profile. This NuGet package work for console, WPF, Unity but not for UWP. To Reproduce Steps to reproduce the behavior:

  1. Create blank UWP project.
  2. Install NuGet package
  3. Try example that was showed in README example. (Works only for console and WPF)

Expected behavior Should simply show status in RPC.

Desktop (please complete the following information):

Logs

It doesn't return anything.

Nothing in update, nothing in ready.

https://github.com/Lachee/discord-rpc-csharp/assets/88881607/a5a02b1a-e4b4-484d-ac2c-a9cb51930365

Lachee commented 1 year ago

Im not sure how UWP dispatches events from Main Thread. I have no experience in this framework. I'll investigate when i have the time :)

J0nathan550 commented 1 year ago

Thanks a lot wish you good luck!

(Also I tried regular discord SDK, and it seems that UWP doesn't want to load other .dlls that doesn't really belong to .exe

(I had error where dll doesn't want at all no matter what I tried.

J0nathan550 commented 5 months ago

Im not sure how UWP dispatches events from Main Thread. I have no experience in this framework. I'll investigate when i have the time :)

Things are more difficult, As I understand the error comes from UWP itself. Because UWP was designed to be trusted, half things that this library does cannot do UWP do security reasons. You need to provide app fullTrust, problem is, I don't understand how this library access certain .exe to activate RPC status. Can you explain?

J0nathan550 commented 5 months ago

I debugged the library and simply UWP denies all pipes that does the library due security reasons once again. Problem of UWP is that you have to manually set all trusted .exes that should program use, which is lame. WPF is better :(