C#
This C# SDK is used in the .NET environment, including Common Language Runtime (CLR). It is frequently used in cross-platform iOS and Android app titles created using the free, open-source Xamarin platform. This SDK is also used in games and apps coded in native C# for the Windows platform.
If you have questions about the SDK or need help in resolving issues, go to PlayFab forums > API and SDK.
Download links
This SDK is auto-generated using our open-sourced tool—SDKGenerator. We generally build SDKs every other week to stay current with the latest API changes.
Key components in this SDK
This C# PlayFab SDK package consists of three different API combinations.
- PlayFabClientSDK - Contains only client libraries. This is designed for integration on your game client.
- PlayFabServerSDK - Contains only server and admin APIs. This is designed for integration on your custom logic server or build process
- PlayFabSDK - Contains all APIs in one SDK (client, server, and admin), as well as, a unit-test project.
When not to use this SDK
The C# PlayFab SDK should not be used if there is a more specific SDK that is suited for your project.
Specific PlayFab SDK is available for:
For a full list of the different PlayFab SDKs, see Azure PlayFab SDK.
Using the SDK
This native C# project can be used in these two ways.
Admin tools for maintaining your game
- Usually, you will want to make synchronous calls back-to-back.
- Each API call will lock the program while it's executing, but that's not an issue for this type of program.
- See the comment about
loginTask.Wait()
in the example code below. This is how you'll usually make API calls.
An actual game coded in native C#
- You need to take advantage of the async nature of API calls, and the C# async/await feature keywords. For more information about asynchronous programming, see Asynchronous Programming with async and await (C#).
Add SDK to your project
Alternatively, you can install the NuGet package into your Visual Studio project using the NuGet Package Manager. For instructions, see Install and use a package in Visual Studio. For more information, see Getting started with NuGet.