discord / gamesdk-and-dispatch

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

Unity: DLL not found unless put in the same folder as the game.exe manually #129

Open mastef opened 3 years ago

mastef commented 3 years ago

After going through all the instructions, and keeping all the dll files in Plugins/x86_64 and Plugins/x86 the game is being built, and the compiled version of the game ends up with the dll based on the 32 or 64 build in the gamename_Data/Plugins folder.

The issue is that the game then doesn't see the discord_game_sdk.dll for some reason, and then fails with System.DllNotFoundException: discord_game_sdk.

image

This is only resolved by moving the gamename_Data/Plugins/discord_game_sdk.dll manually to the root folder, right next to the gamename.exe.

A second issue with this fix is that the discord_game_sdk.dll is then only loaded if the game is being started with administrator rights. Otherwise it fails with an internal error: image

Stealcase commented 2 years ago

This might be an issue with Unity itself. I had a similar experience when building with Unity 2019.1 with some other dlls.

What version of Unity are you on?

mastef commented 2 years ago

Latest LTS - Unity 2020.3.x

Other plugins that ship their dll file do not have this issue.

On Mon, Nov 29, 2021, 23:49 Stealcase @.***> wrote:

This might be an issue with Unity itself. I had a similar experience when building with Unity 2019.1 with some other dlls.

What version of Unity are you on?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/discord/gamesdk-and-dispatch/issues/129#issuecomment-981817439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF2DOKRQ6OULC6KXPPM6T3UOOVH3ANCNFSM5A5HYLMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.