discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

ExecutionEngineException on Discord.RunCallbacks in C# (WPF) #120

Open TheBlue-1 opened 3 years ago

TheBlue-1 commented 3 years ago

Describe the bug Sometimes my app crashes because of an ExecutionEngineException thrown in the discord_game_sdk.dll

Steps to reproduce Steps to reproduce the behavior:

  1. Create a C# WPF project in VS
  2. Implement a loop calling Discord.RunCallbacks()
  3. Implement some basic lobby/activity creation
  4. Debug it and the error should appear

Expected behavior No ExecutionEngineExceptions

Implementation specifics

vkuhlmann commented 3 years ago

That's a vague error type, and those are unspecific steps to reproduce. That's not a blame, it's the error being very generic. According to Microsoft Docs, an ExecutionEngineException is "The exception that is thrown when there is an internal error in the execution engine of the common language runtime."

I want you to confirm some things:

Note: I'm not a Discord developer, only just like you a developer who has once worked with the Game SDK. Also, the Game SDK is barely or not maintained at the moment, so if I can't help you, you might need to change your plans.

Next, there is a server where developers using the Game SDK help each other: go to discord.gg/discord-developers, and after having joined, it's the #game-sdk channel. Make sure to have read the #rules first though.

Vercidium commented 3 years ago

I had a similar issue and I believe it's caused by garbage-collected delegates. It's a bug in Core.cs that is yet to be fixed.

There's details here on how to fix it: https://github.com/discord/gamesdk-and-dispatch/issues/102

TheBlue-1 commented 3 years ago

Since I fixed the bug #36 it worked for me. But I currently dont work that much on my project, so I cant say that it is really gone.