Write your XBOX game in C#, not in P/Invoke. XBOX GDK.NET is the .NET projection of the Microsoft GDK flat C API, exposing the Gaming Runtime, XBOX Services and PlayFab as ordinary modern C# - Task, IDisposable, events, exceptions and [Flags] enums instead of HRESULTs, raw handles, XAsyncBlocks and two-call size buffers. GDK.Net is the assembly, package and root namespace name, so it is what you see in code; XBOX GDK.NET is the name of the product.
Important
This is source, not a product. The projection is MIT-licensed, but the Microsoft GDK and the PlayFab extension libraries it binds to are installed and licensed separately, consistent with other XBOX samples. There is no specified update cadence. We will watch the repo, monitor issues, and iterate where it makes sense. We are keen to hear your feedback and to see community PRs.
Windows-only, and pinned to one GDK edition. Everything here is built and verified against Microsoft GDK edition 260404. Building needs no GDK install at all; running against the Gaming Runtime needs the GDK, a dev-unlocked machine and a signed-in account. CI can only build, test and verify NativeAOT compilation - behaviour is validated by hand in a packaged title against a real sandbox.
| I want to... | Start here |
|---|---|
| Add the projection to an existing .NET game | Getting started |
| Clone, build and run the samples from source | Building |
| See exactly what is projected, and what is not | Projection status |
| Ship my .NET title on XBOX consoles | Request access as a licensed XBOX developer |
| Draw the runtime's dialogs myself | Title-implemented UI |
| Move to a newer GDK edition | The pinned GDK edition |
| Browse the full documentation tree | Documentation index |
Building needs nothing but the .NET SDK:
dotnet restore
dotnet build -c Release
dotnet test -c Release --no-buildTo run against the Gaming Runtime you need an installed GDK, a dev-unlocked machine and a signed-in XBOX account - but not a package:
pwsh eng/run-local.ps1 -Project Sample # readable demo, self-contained, unpackaged
pwsh eng/run-local.ps1 # the live harness, same
pwsh eng/run-package-tests.ps1 # the packaged path, which is what a title ships asGDK.Net projects the GDK surface a .NET title actually needs, generated and verified against the real headers of edition 260404 rather than transcribed by hand:
- Gaming Runtime - users and sign-in, game invites and protocol activation, storage, packages and DLC, game saves, game UI, networking, capture and broadcast, the Store, game streaming, accessibility, speech, and system metadata
- XBOX Services - profile, achievements, social, presence, privacy, leaderboards, real-time activity, user and title-managed statistics, title storage, string verification, events, multiplayer activity, plus the social and achievements manager layers
- PlayFab - Core and the full generated Services surface, Game Saves, Multiplayer (Lobby and Matchmaking), and Party including PartyXboxLive
- NativeAOT - AOT-safe on
net8.0andnet10.0, enforced by analyzers, warnings-as-errors and a real ILC compilation in CI
Coverage is measured, not asserted: 349 of 355 Gaming Runtime exports and 1,006 of 1,008 PlayFab exports are bound, the remainder being deliberately out of scope. Run eng/api-coverage.ps1 for the current tally, and see Projection status for what is excluded and why.
The projection ships no native code of its own. Every P/Invoke binds to redistributable modules the GDK already installs.
The core projection is one assembly. XBOX Services and PlayFab are separate native modules, so they are opt-in at packaging time - a title that does not use them does not carry them.
| Opt-in property | Native modules | Managed surface |
|---|---|---|
| (always) | xgameruntime.thunks.dll |
GDK.Net - the Gaming Runtime: GameRuntime, UserManager, GamePackage, GameSaveProvider, StoreContext, NetworkingManager, and the rest |
<GdkNetIncludeXboxLive> |
Microsoft.Xbox.Services.C.Thunks.dll, libHttpClient.dll |
GameRuntime.XboxLive - profile, achievements, social, presence, privacy, leaderboards, stats, title storage, and the manager layers |
<GdkNetIncludePlayFab> |
PlayFabCore.dll, PlayFabServices.dll, PlayFabGameSave.dll, libHttpClient.dll |
GDK.Net.PlayFab - PlayFabRuntime, the 20 generated service classes, PlayFabGameSaveFiles |
<GdkNetIncludePlayFabMultiplayer> |
PlayFabMultiplayer.dll |
GDK.Net.PlayFab.Multiplayer - lobbies and matchmaking |
<GdkNetIncludePlayFabParty> |
Party.dll, PartyXboxLive.dll |
GDK.Net.PlayFab.Party - voice, text chat and network transport |
The last two PlayFab groups import PlayFabCore.dll, so asking for either turns <GdkNetIncludePlayFab> on as well. eng/packaging/GdkRedist.targets copies the modules you asked for next to the executable on every build.
| Runtime / version | Tier | Architectures (RIDs) | GDK edition | Build toolchain | Status |
|---|---|---|---|---|---|
net8.0 |
LTS, Primary tier | win-x64 (primary), win-arm64 |
260404 |
.NET SDK 10.0.x (verified locally: 10.0.302; 9.0.316 also present), MSVC v143+ / Windows SDK, ClangSharp for binding generation | Supported |
net10.0 |
LTS, Primary tier | win-x64 (primary), win-arm64 |
260404 |
.NET SDK 10.0.x (verified locally: 10.0.302; 9.0.316 also present), MSVC v143+ / Windows SDK, ClangSharp for binding generation | Supported |
netstandard2.0 |
Compatibility tier (MonoGame / Mono / broad reach) | win-x64 (primary), win-arm64 |
260404 |
.NET SDK 10.0.x (verified locally: 10.0.302; 9.0.316 also present), MSVC v143+ / Windows SDK, ClangSharp for binding generation | Supported |
| Engine / framework | Version(s) | Tier | Status |
|---|---|---|---|
| MonoGame | latest stable Windows project/template (policy: validate current stable release during pilot/live harness work) | Release gate for game workflow integration | Supported |
| Stride | latest stable (policy: scheduled/nightly validation after the pilot locks conventions) | Secondary engine workflow integration | Supported |
| Bespoke hosts and tooling | Microsoft-supported .NET LTS hosts on Windows | Primary tools/services workflow | Supported |
Only Microsoft-supported .NET LTS releases are targeted; the window moves as LTS releases ship and go EOL. netstandard2.0 exists solely for MonoGame/Mono reach. This projection is Windows-only (no Linux/macOS), and the GDK edition is pinned at 260404.
Full documentation lives in docs/.
Start here:
- Documentation index - the full doc tree
- Getting started - the idioms the projection uses, initialising
GameRuntime, signing in a user - Building - prerequisites, build and test, running unpackaged, packaging, the generation tooling
- Architecture - the two layers, the native modules, the three target frameworks, the AOT contract, threading
- Projection status - what is projected, what is out of scope, and the current coverage numbers
Reference:
- API reference - every public type and member, generated from the XML doc comments, indexed by area
- Repository layout - where things live, and what is generated rather than authored
- The pinned GDK edition - minimum version and the full re-pin procedure
- Microsoft GDK - Microsoft GDK product details
- PlayFab Unified SDK - PlayFab Unified SDK product details
- XBOX Godot Sample - the same GDK surface bound into Godot 4, usable from GDScript and C#
- Open an issue - bugs and feature requests
SUPPORT.md- how to file issues, and what to includeCONTRIBUTING.md- the CLA, and what a change here has to satisfySECURITY.md- security vulnerability reporting (MSRC; please do not file security issues via GitHub)CODE_OF_CONDUCT.md- Microsoft Open Source Code of Conduct
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.