Export (0) Print
Expand All

GamerServicesDispatcher.Initialize Method

Initializes gamer services functionality for the game, automatically choosing the most appropriate gamer service type for the platform.

Call this method during startup of your game.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

public static void Initialize (
         IServiceProvider serviceProvider


Type: IServiceProvider
The service provider to be used when locating additional services services. For example, IGraphicsDeviceService.

Exception typeCondition
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException serviceProvider is null.
InvalidOperationExceptionGamer services has already been initialized.


Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

This method automatically chooses the default gamer service type for your platform (Xbox LIVE for Xbox 360 and Windows, or Xbox LIVE on Windows Phone for Windows Phone). If you need to explicitly choose the gamer service type, use GamerServicesDispatcher.Initialize(System.IServiceProvider, Microsoft.Xna.Framework.GamerServices.GamerServiceType).

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions

© 2015 Microsoft