> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MicrosoftGame.config Element - MSAAppId

> MicrosoftGame.config Element - MSAAppId

# MicrosoftGame.config Element - MSAAppId

指定标题的 MSA 应用 ID，该 ID 与 XBOX Live 标题 ID（如下）一起用于 XBOX Live 服务的标识。自 2022 年 3 月 GDK 起，如果指定了 TitleId 元素，新标题现在需要 MSA 应用 ID。此要求由 MicrosoftGame.config 架构版本更新（从 configVersion 0 到 configVersion 1）强制执行，仅适用于使用 2022 年 3 月及以后 GDK 创建的新标题。

## 父元素

此元素的父元素是 Game 元素。

## 要求

如果 MicrosoftGame.config 中 configVersion = 0，则此元素为可选，无需设置。
如果 MicrosoftGame.config 中 configVersion = 1，则在以下情况下必须设置此元素：

* 指定了 TitleId 元素。
* 指定了 NoCodePCRoot 元素。
* AdvancedUserModel 元素设置为 false 值。

## 平台

此元素适用于 PC 和主机。

## 行为

* 无属性。
* 无默认值。
* 允许值为任何非空字符串。

## 备注

* MSAAppId 的值通常是 16 个字符的整数字符串。
* MSAAppId 元素是从合作伙伴中心生成的标识 ID。可以在合作伙伴中心项目的 [XBOX 服务 -> XBOX 设置选项卡](/services/xbox-services/fundamentals/portal-config/live-setup-partner-center-partners)中找到。
* MicrosoftGame.config 中的 MSAAppId 元素必须与合作伙伴中心的值匹配。[MicrosoftGame.config 编辑器](/build/core-features/common/game-config/MicrosoftGameConfig-Editor)提供了一个名为 Store Association Wizard 的工具，可自动将本地 .config 中的 MSAAppId（以及其他 Id 值）与合作伙伴中心为你的产品提供的内容同步。
* 如果你的标题使用游戏绑定，MSAAppId 元素的行为会有所不同。有关详细信息，请参阅[游戏绑定概述](/services/xbox-services/fundamentals/game-binding/game-binding-overview)。
* Visual Studio 新项目模板将为此元素提供默认值 'PleaseChangeMe'。此值允许你在无需立即从合作伙伴中心获取 Id 的情况下，早期迭代使你的标题编译。强烈建议在标题构建完成后立即更改此 Id，以避免在尝试进行 XUser API 调用时失败。

## 另请参阅

[MicrosoftGame.config 参考 - 目录](/reference/system/microsoftgameconfig/elements/gc-microsoftgameconfig-toc)


## Related topics

- [MicrosoftGame.config Element - NoCodePCRoot](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-nocodepcroot.md)
- [MicrosoftGame.config 元素 - TitleId](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-titleid.md)
- [MicrosoftGame.config 元素 - StoreId](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-storeid.md)
- [MicrosoftGame.config Element - ContentIdOverride](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-contentidoverride.md)
- [MicrosoftGame.config Element - FranchiseGameHubId](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-franchisegamehubid.md)
