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

# NoCodePCRoot 元素 (MicrosoftGame.config)

> MicrosoftGame.config Element - NoCodePCRoot

# MicrosoftGame.config Element - NoCodePCRoot

指定使用[将旧版标题移植到 PC 游戏存档并支持无代码云存档](https://docs.xbox.com/zh-CN/build/core-features/common/game-save/game-saves-walkthroughs-and-samples.md#porting-previous-titles-to-pc-game-saves-with-no-code-cloud-saves)时存储游戏存档的本地文件夹。

## 父元素

父元素是 `SaveGameStorage` 元素。

## 要求

此元素为可选。

## 平台

此元素仅适用于 PC 设备。

## 行为

* 属性为 `RelativeTo`。
* `RelativeTo` 的属性值为 `AppData`、`Public`、`LocalAppData`、`LocalAppDataLow`、`ProgramData`、`SavedGames` 或 `UserProfile`。
* 允许值为相对文件路径。

## 备注

* 要使用此元素，请在 `MicrosoftGame.config` 文件中指定有效的 `TitleId` 和 `MSAAppId` 元素。
* 使用 `SavedGames` 作为 `RelativeTo` 值。"已保存的游戏" 文件夹 (`%USERPROFILE%\Saved Games`) 对应于 `FOLDERID_SavedGames`。OneDrive 默认不会同步此文件夹。此行为有助于避免与云存档同步发生冲突。OneDrive 自动同步可能影响其他位置，例如 AppData。

> [!NOTE]
>
> `NoCodePCRoot` 重定向仅在你通过 `wdapp install` 以打包构建方式启动标题时有效。直接启动 .exe 会绕过重定向，直接读写到物理 `NoCodePCRoot` 路径，而不会进行云同步。在打包启动和直接 .exe 启动之间切换可能会导致存档数据看起来丢失。有关详细信息，请参阅[将旧版标题移植到 PC 游戏存档并支持无代码云存档](https://docs.xbox.com/zh-CN/build/core-features/common/game-save/game-saves-walkthroughs-and-samples.md#porting-previous-titles-to-pc-game-saves-with-no-code-cloud-saves)。

## 另请参阅

[MicrosoftGame.config 参考 - 目录](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/gc-microsoftgameconfig-toc.md)

[将旧版标题移植到 PC 游戏存档并支持无代码云存档](https://docs.xbox.com/zh-CN/build/core-features/common/game-save/game-saves-walkthroughs-and-samples.md#porting-previous-titles-to-pc-game-saves-with-no-code-cloud-saves)


## Related topics

- [MicrosoftGame.config 元素参考（内容）](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/gc-microsoftgameconfig-toc.md)
- [SaveGameStorage 元素 (MicrosoftGame.config)](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-savegamestorage.md)
- [TitleId 元素 (MicrosoftGame.config)](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-titleid.md)
- [MSAAppId 元素 (MicrosoftGame.config)](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-msaappid.md)
- [EnableWritesToPackageRoot 元素 (MicrosoftGame.config)。](https://docs.xbox.com/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-enablewritestopackageroot.md)
