question

zero avatar image
zero asked

Integrating GSDK into C# console app

Hello,

I am following the instruction here to create a PlayFab Multiplayer Game Server Build:
https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/integrating-game-servers-with-gsdk

I have created a Console App (.NET Framework v4.7.1)
I add the NuGet package com.playfab.csharpgsdk (v0.11.210519)
I have a very simple Main:

static void Main(string[] args)
{
    Console.Write("Initializing");
    GameserverSDK.Start();
    Console.Write("GSDK Start Complete.");



    if (GameserverSDK.ReadyForPlayers())
    {
	Console.Write("Ready for Players");
    }
    else
    {
        Console.Write("Shutdown");        
    }
}



But I am getting this error:

Microsoft.Playfab.Gaming.GSDK.CSharp.GSDKInitializationException: 'GSDK file -  not found'

As a test I have also tried adding the PlayFabAllSDK (v1.95.210629) NuGet package as well.

Please advise, thanks.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

When you start debugging in visual studio (or any other IDE), GSDK is lack of running environment and it is the reason that causes this issue. You check this tutorial to Locally debugging game servers and integration with PlayFab - PlayFab | Microsoft Docs.

Besides of the official documents, PlayFab also provides few samples on GitHub. Since you are developing C# projects, here are the official repositories.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.