Problems with Unity and the GameLift server SDK

Hello, I’ve followed the steps to integrate the GameLift server SDK into Unity (2017.1.3p2). I made sure the API Compatibility level is “.NET 2.0” and the Scripting Runtime Version is set to "Stable (.NET 3.5 Equivalent). I downloaded the SDK, opened up the GameLiftServerSDKNet35 solution into Visual Studio 2015 and built Release. I copied over the 8 DLLs from the bin\Release folder into an Assets\Plugins subfolder for Unity.

I get script compile errors saying "error CS0433: The imported type ‘System.Threading.Timer’ is defined multiple times’. It is defined in System.Threading.Tasks.NET35.dll, but, with my setup it seems that it is also in another assembly (from what I remember something like System.Core.dll).

I did manage to get something working by replacing System.Threading.Tasks.NET35.dll with System.Threading.dll (something Microsoft distributed with Reactive Extensions I think), and then making a few minor code changes due to the small differences in the usage of Task.

Things work great for a Windows build of our game running as a dedicated server. If I make a Linux build then I will eventually hit an exception of “EntryPointNotFoundException: SwitchToThread” when it calls to Aws stuff (but, like I said, works in Windows). I would like to use the correct way, but I can’t because of the errors mentioned at the top.

Has anyone run into these problems? Is our project just complicated enough that we run into System.Threading.Tasks.NET35 issues?

Thank you,

Jeff

Hi @JSlutter, thanks for bringing this to our attention. It looks like you’re setting everything up correctly. I’ll see if I can reproduce your errors and get back to you.

Thanks,

Ben

we had same issue, if some there in project you have usage of System.Threading.Timer, when this error will occur, in our case it was unirx threading pool scheduler, we just cut it out… but it will be better if gamelift will encapsulate definition and usage System.Threading.Timer (or just reimplement it in its own namespace) in their packages\System.Threading.Tasks.Unofficial.3.1\lib\net35\System.Threading.Tasks.NET35.dll