C# Quickstart#

C# SDK#

The Xsolla Backend C# SDK is written for compatibility with the .NET 4.x and .NET Standard 2.0 runtimes. We make the assumption that most developers working on our C# SDK will be doing so on Windows as their development platform, but the target platforms may vary.

Unity SDK#

Warning

Looking for the Unity SDK, instead? Ignore this guide! Instead, jump to the Quickstart guide for the unity_sdk project repo.

Xsolla Backend C# Client SDK#

The Xsolla Backend client SDK for C# / .NET provides a set of data models, utilities and other functionality for working with Xsolla Backend services. The library is compatible with .NET Standard 2.1.

Getting Started#

The library is available on NuGet and can be installed through the NuGet Package Manger or, you may optionally build the project yourself.

Installation via NuGet#

The simplest way to install the C# SDK is through NuGet. In PowerShell, run:

NuGet\Install-Package xsollabackend.sdk -Version 4.0.1

Building on Windows#

You will need .NET Standard 2.1 and .NET Framework 4.6.1 components installed. This project is tested for use with Visual Studio 2022, for full compatibility:

  1. Open the sdk_csharp.sln solution file.

  2. Select Build Solution.

Build Standalone C# SDK and Tests#

This project is tested for use with Visual Studio 2022. You will need .NET Standard 2.1 to build the SDK and .NET Core 3.1 to build the tests. You can install these components if missing when loading the projects in Visual Studio 2022 by right-clicking on the unloaded project and selecting Install Missing Components. Once all components are installed, you can build the SDK by right-clicking on the sdk_csharp.sln solution file and selecting Build Solution:

  1. Open the sdk_csharp.sln solution file.

  2. Select either Debug or Release build target.

  3. Select Build Solution.

The output of the build will be located in the lib folder. For example, the build output for the Release build target will be located within the dir:

sdk_csharp\lib\Release\Standalone\netstandard2.1\

To run tests, navigate to the Test Explorer window in Visual Studio 2022. If the Test Explorer window is not visible, you can open it by selecting Test > Windows > Test Explorer from the Visual Studio 2022 menu. Once the Test Explorer window is open, select Run All to run all tests.

Examples & Sample Integration#

Looking for different ways to utilize the C# SDK?

We highly recommend the UnityChessGame sample, containing integration of Xsolla Backend into a Unity project.

Note

Looking for free, live support? Join our discord for staff and community surrounding the greater Xsolla Backend community; we’d love to get to know you and your project.