> ## 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 其他參考

> MicrosoftGame.config 其他參考

# MicrosoftGame.config 其他參考

## 摘要

本文說明 MicrosoftGame.config 檔案的其他詳細資料與參考資料，其中包含下列各節。

| 章節 | 描述 |
| - | - |
| [元素詳細資料](#MicrosoftGameConfig-Elements) | 提供 MicrosoftGame.config 元素名稱、用途與附註的清單。 |
| [範例 MicrosoftGame.config 檔案](#MicrosoftGameConfig-Example) | 提供適用於 XBOX 和 PC 的 MicrosoftGame.config 範例。 |
| [MicrosoftGame.config 的 XSD 結構描述](#XSD-Schema-id) | 提供用來驗證 MicrosoftGame.config 之 XSD 結構描述的詳細資料。 |
| [先前的元素參考](#MicrosoftGameConfig-OldElements) | 提供已變更之重要元素的清單，包括對 ERA 變更的參考。 |
| [MicrosoftGame.config 與 DLC 建立](#MicrosoftGameConfig-DLC) | 提供為 DLC 產品建立 MicrosoftGame.config 的詳細資訊。 |
| [另請參閱](#MicrosoftGameConfig-SeeAlso) | 提供與 MicrosoftGame.config 相關之其他文件的連結。 |

<a id="MicrosoftGameConfig-VersionDetails" />

### Game configVersion 詳細資料

自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，對於使用 Microsoft Game Development Kit (GDK) 工具產生的新 MicrosoftGame.config 檔案，Game configVersion 已從 0 更新為 1。自 2023 年 10 月 GDK 起，所有遊戲都必須使用 configVersion="1"。對於使用 2023 年 10 月 GDK 並以 configVersion="0" 提交的遊戲，Submission Validator 將回報 FAILURE。

Game configVersion 0 與 1 之間的變更如下。

* 若 MicrosoftGame.config 中指定了 MSAAppId 或 TitleId 元素其中之一，則兩者皆為必要 (亦即，若指定了 TitleId，也必須指定 MSAAppId)。
* 若指定了 NoCodePCRoot 元素，或 AdvancedUserModel 元素設定為 false，則 MSAAppId 和 TitleId 元素為必要。
* ModFolder、EnableWritesToPackageRoot、DisableFilesystemWriteVirtualization 和 DisableRegistryWriteVirtualization 元素在 configVersion 1 中已被取代。

結構描述中所定義的哪些需求會針對遊戲執行，是由 MicrosoftGame.config 中的此值所定義：

```xml theme={null}
<Game configVersion="1">
```

Game configVersion 允許的值為 0 和 1。這些新需求不會影響升級至 2022 年 3 月 Microsoft Game Development Kit (GDK) 的現有遊戲，因為其 Game configVersion 將維持設定為 0。

<a id="MicrosoftGameConfig-Elements" />

### 元素詳細資料

本節詳細說明 MicrosoftGame.config 中可定義之元素的元素名稱、是否為必要、用途、父節點及其他附註。

| 節點名稱 | 必要 | 用途 | 父系 | 附註 |
| - | - | - | - | - |
| [Game](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-game) | 必要 | 包含所有其他內容的單一父節點 | | |
| <a id="MGC-Identity" /> [Identity](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-identity) | 必要 | 定義遊戲的 Name、Publisher 和 Version | Game | 遊戲資訊可在 Partner Center 的 \[產品管理] -> \[產品身分識別] 下找到；請參閱[在 Partner Center 中設定遊戲 (適用於受管理的合作夥伴)](/zh-TW/services/xbox-services/fundamentals/portal-config/live-setup-partner-center-partners)。<br /> 在註冊期間用來唯一識別遊戲。<br /> Name 和 Publisher 為必要欄位。<br /> 若未指定，Version 預設為 1.0.0.0。<br /> 後續主機世代的其他套件必須將套件主要版本遞增至超過現有的套件版本。 |
| <a id="MGC-ShellVisuals" /> [ShellVisuals](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-shellvisuals) | 封裝組建時為必要 | 定義遊戲在 Shell 中的呈現方式，例如影像和名稱。 | Game | 在註冊期間用來在 Shell 中顯示遊戲。 |
| <a id="MGC-Languages" /> [Resources](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-resources) | 選用 | 用來將 Shell Visuals 當地語系化的語言地區設定配對清單。 | Game | 由於保留了相同格式，可從現有的 AppxManifest 複製並貼上。<br /> 如需詳細資訊，請參閱[封裝](/zh-TW/build/core-features/common/packaging/gc-packaging-toc)。 |
| [Resource](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-resource) | 選用 | Resources 清單中個別的語言地區設定項目。 | Resources | |
| [ExecutableList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-executablelist) | 必要 | 遊戲可執行檔的清單。 | Game | 至少需要一個項目，才能成功註冊或封裝遊戲。<br /> "IsDevOnly" 屬性可讓您確保此項目不會包含在提交簽署的套件中。<br /> Display Name 和 Logo 的覆寫可讓此 exe 在 Shell 中使用唯一的值 (除非在此處另行覆寫，否則上方 "ShellVisuals" 節點中指定的資源將是每個 exe 的預設值)。 |
| <a id="MGC-Executable" /> [Executable](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-executable) | 必要 | 指定特定可執行檔的詳細資料。 | ExecutableList | 本節屬性包括可執行檔的名稱 (Name)、其建置目標裝置 (TargetDeviceFamily)、其應用程式識別碼 (Id)、是否為僅限開發的可執行檔 (IsDevOnly)、是否應覆寫 ShellVisuals 節點中的顯示名稱 (OverrideDisplayName)、是否應覆寫 ShellVisuals 節點中的 Logo (OverrideLogo)、是否應覆寫 ShellVisuals 節點中的 Square480x480Logo (OverrideSquare480x480Logo)、是否應覆寫 ShellVisuals 節點中的 Square44x44Logo (OverrideSquare44x44Logo)、是否應覆寫 ShellVisuals 節點中的 SplashScreenImage (OverrideSplashScreenImage)，以及可執行檔是否有別名 (Alias (目前僅限 Desktop)。 |
| <a id="MGC-AdvancedUserModel" /> [AdvancedUserModel](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-advancedusermodel) | 選用 | 指定您的遊戲是否應使用進階使用者模型。 | Game | 這表示您的遊戲支援在不需要重新啟動的情況下變更作用中使用者。若停用，則會使用簡單使用者模型，以保證您的遊戲一律保留啟動時的作用中使用者。如需詳細資訊，請參閱 [GDK 使用者模型 (NDA 文章)](/zh-TW/build/core-features/common/user/gamecore-user-models)。 |
| <a id="MGC-Protocol" /> [Protocol](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-protocol) | 選用 | 可用來啟動遊戲，或在遊戲已在執行時將其帶到前景的自訂通訊協定。 | ProtocolList | 同時指定自訂通訊協定的名稱，以及可選擇性指定的可執行檔路徑。如需詳細資訊，請參閱[通訊協定啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/protocolactivation)。 |
| <a id="MGC-ProtocolList" /> [ProtocolList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-protocol) | 選用 | 指定可用來啟動遊戲，或在遊戲已在執行時將其帶到前景的自訂通訊協定集合。 | Game | 必須提供至少一個 Protocol。如需詳細資訊，請參閱[通訊協定啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/protocolactivation)。 |
| <a id="MGC-GameOsVersion" /> [GameOsVersion](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-gameosversion) | 選用 (僅限主機) | 指定此遊戲執行所需的 Microsoft Game Development Kit (GDK) Game OS 版本。 | Game | 若未指定，將使用目前執行中或預設的 Game OS。 |
| <a id="MGC-WindowsOsVersion" /> [WindowsOsVersion](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-windowsosversion) | 選用 (僅限 PC) | 指定此遊戲執行所需的最低及建議 Windows 版本。 | DesktopRegistration | 允許的值為四部分的版本號碼 (例如 10.0.19045.3570)，選項為 RequiredMinimum="#.#.#.#"、SuggestedMinimum="#.#.#.#" Recommended="#.#.#.#"  此建議最低版本元素預設為 10.0.19045.3570 |
| <a id="MGC-MediaCapture" /> [MediaCapture](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-mediacapture) | 選用 (僅限主機) | 指定此遊戲執行時，系統媒體擷取應用程式的所需行為。 | Game | 媒體擷取需要設定遊戲身分識別才能正常運作。 |
| [GameDVRSystemComponent](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-gamedvrsystemcomponent) | 選用 (僅限主機) | 指定是否啟用 Game DVR 系統元件。 | MediaCapture | |
| [BlockBroadcast](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-blockbroadcast) | 選用 (僅限主機) | 指定應封鎖或允許廣播遊戲。 | MediaCapture | |
| [BlockGameDVR](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-blockgamedvr) | 選用 (僅限主機) | 指定應封鎖或允許遊戲的 Game DVR 錄製。 | MediaCapture | |
| [StoreId](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-storeid) | 選用 | 指定此遊戲的市集身分識別。 | Game | 在 Partner Center 的 \[產品管理] -> \[產品身分識別] 下指定。 |
| [AllowedProducts](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-allowedproducts) | 選用 | 指定此可下載內容套件 (DLC) 遊戲所屬之相關遊戲的 StoreId。 | Game | 如需詳細資訊，請參閱[可下載內容套件 (DLC)](/zh-TW/build/core-features/common/packaging/packaging-downloadable-content-dlc)。 |
| [AllowedProduct](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-allowedproduct) | 選用 | 指定此可下載內容套件 (DLC) 遊戲所屬之相關遊戲的 StoreId。 | AllowedProducts | |
| [RelatedProducts](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-relatedproducts) | 選用 | 指定與此 DLC 遊戲相關之產品的 StoreId。 | Game | 如需詳細資訊，請參閱[可下載內容套件 (DLC)](/zh-TW/build/core-features/common/packaging/packaging-downloadable-content-dlc)。 |
| [RelatedProduct](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-relatedproduct) | 選用 | 與此 DLC 遊戲相關之產品的特定 StoreId 項目。 | RelatedProducts | |
| [TargetDeviceFamilyForDLC](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-targetdevicefamilyfordlc) | 選用 (僅限 DLC) | 指定 DLC 套件的建置目標平台。允許的值為 XboxOne、Scarlett 和 PC | Game | |
| [PublisherContent](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-publishercontent) | 選用 | 宣告此基礎遊戲支援由發行者裝載的內容套件。 | Game | 如需詳細資訊，請參閱[發行者內容套件](/zh-TW/build/core-features/common/packaging/packaging-publisher-content)。 |
| [ManifestUrl](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-manifesturl) | 選用 | 用來識別目前由發行者裝載之內容套件的 JSON 資訊清單 URL。 | PublisherContent | |
| [PublisherContentBaseProduct](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-publishercontentbaseproduct) | 選用 (僅限發行者內容) | 指定此由發行者裝載之內容套件所屬基礎遊戲的 StoreId。 | Game | 將套件標示為發行者內容套件。 |
| <a id="MGC-PLS" /> [PersistentLocalStorage](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-persistentlocalstorage) | 選用 (僅限主機) | 指定遊戲持續性本機儲存體的所需大小。 | Game | 持續性本機儲存體需要設定遊戲身分識別才能正常運作。 |
| [SizeMB](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-sizemb) | 選用 (僅限主機) | 指定持續性本機儲存體的最小大小 (MB)。 | PersistentLocalStorage | 持續性本機儲存體需要設定遊戲身分識別才能正常運作。 |
| [GrowableToMB](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-growabletomb) | 選用 (僅限主機) | 指定持續性本機儲存體隨時間可成長到的最大大小 (MB)。 | PersistentLocalStorage | 持續性本機儲存體需要設定遊戲身分識別才能正常運作。 |
| <a id="MGC-MemoryConfig" /> [VirtualMachine](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-virtualmachine) | 選用 (僅限主機) | 指定特定 XBOX One 硬體上的遊戲記憶體配置。 | Game | |
| [XboxOneXTitleMemory](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-xboxonextitlememory) | 選用 (僅限主機) | 指定 XBOX One X 主機的遊戲記憶體設定。 | Virtual Machine | 允許的值為 "Standard" 或 "Advanced"。 |
| [XboxLockhartTitleMemory](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-xboxlockharttitlememory) | 選用 (僅限主機) | 指定 XBOX Series S 主機的遊戲記憶體設定。 | Virtual Machine | 允許的值為 "Standard" 或 "Advanced"。 |
| [XboxAnacondaTitleMemory](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-xboxanacondatitlememory) | 選用 (僅限主機) | 指定 XBOX Series X 主機的遊戲記憶體設定。 | Virtual Machine | 允許的值為 "Standard" 或 "Advanced"。 |
| <a id="MGC-Smt" /> [SMTEnabled](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-smtenabled) | 選用 (僅限主機) | 指定是否啟用 SMT。 | Virtual Machine | |
| <a id="MGC-EraShim" /> [RequiresEraShim](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-requireserashim) | 選用 (僅限主機) | 指定是否需要 XBOX One ERA Shim。 | Virtual Machine | |
| <a id="MGC-XboxCompat" /> [XboxCompatibility](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-xboxcompatibility) | 選用 (僅限主機) | 指定遊戲相容的最高主機世代。 | Virtual Machine | 開發人員會將此元素用於在 XBOX Series X\|S 上以回溯相容性執行的 XBOX One 遊戲。其主要用途是存取增強功能，例如額外的記憶體。允許的值為 "XboxOne" (其行為與一般回溯相容遊戲相同) 和 "Scarlett" (可讓回溯相容遊戲存取增強功能)。 |
| <a id="MGC-DlcCompat" /> [DlcCompatibility](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-dlccompatibility) | 選用 (僅限主機) | 指定遊戲相容之 DLC 的最低主機世代。 | Virtual Machine | 開發人員會將此元素用於在 XBOX Series X\|S 主機上執行，但希望載入為 XBOX One 建置之 DLC 套件的 XBOX One 遊戲。這可讓 DLC 存在於任何儲存體上，而不只是快速儲存體。 |
| [MSAFullTrust](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-msafulltrust) | 選用 (僅限 PC Desktop) | 指定遊戲是否宣告為 "MSA Full Trust"。 | Game | 除非您的客戶經理另有說明，否則不應使用此元素。 |
| [MSAAppId](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-msaappid) | 必要 | 指定遊戲的 MSA 應用程式識別碼，此識別碼會與 XBOX Live 遊戲識別碼 (如下所示) 搭配使用，作為 XBOX Live 服務的身分識別。 | Game | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，若指定了 TitleId 元素，則必須存在 MSAAppId 元素。 |
| [TitleId](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-titleid) | 選用 | 指定遊戲的 XBOX Live 遊戲識別碼，用作 XBOX Live 服務的身分識別。 | Game | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，若指定了 MSAAppId 元素，則必須存在 TitleId 元素。 |
| <a id="MGC-RequiresXboxLive" /> [RequiresXboxLive](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-requiresxboxlive) | 選用 | 指定遊戲是否需要 XBOX Live 連線才能執行。 | Game | |
| [ExtendedAttributeList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-extendedattributelist) | 選用 | 現有元素以外之其他屬性的後援。 | Game | 除非您的客戶經理另有說明，否則不應使用此元素。 |
| [ExtendedAttribute](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-extendedattribute) | 選用 | Extended Attribute List 中的特定後援指定。 | Game | 除非您的客戶經理另有說明，否則不應使用此元素。 |
| [DesktopRegistration](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-desktopregistration) | 選用 (僅限 PC Desktop) | 指定在 PC 桌面平台上註冊遊戲時要使用的屬性。 | Game | |
| <a id="MGC-ProcessorArch" /> [ProcessorArchitecture](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-processorarchitecture) | 選用 (僅限 PC Desktop) | 指定與您的遊戲可執行檔相符的處理器架構。 | DesktopRegistration | 此元素的屬性範例為 x64 和 x86。 |
| [MainPackageDependency](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-mainpackagedependency) | 選用 (僅限 PC Desktop DLC) | 指定您的 DLC 所屬之基礎套件的身分識別。 | DesktopRegistration | |
| <a id="MGC-FrameworkDependency" /> [DependencyList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-dependencylist) | 選用 (僅限 PC Desktop) | 決定在安裝遊戲套件之前需要安裝哪些架構套件。 | DesktopRegistration | 如需子元素用法的詳細資訊，請按一下[這裡](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema#MGC-Dependency)。 |
| [KnownDependency](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-knowndependency) | 選用 (僅限 PC Desktop) | 指定其中一個常用架構套件的捷徑。 | DependencyList | 必須指定 name 屬性，MinVersion 則會自動設定。如需可能的捷徑清單，請參閱下列結構描述中的 ST\_KnownDependency 一節。 |
| <a id="MGC-Dependency" />[Dependency](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-dependency) | 選用 (僅限 PC Desktop) | 必須在遊戲之前安裝的特定架構套件與版本。 | DependencyList | 必須設定 name 和 MinVersion 屬性。 |
| <a id="MGC-CustomInstaller" /> [CustomInstallActions](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-custominstallactions) | 選用 (僅限 PC Desktop) | 指定在您的遊戲第一次執行時，以系統管理權限執行的自訂安裝程式動作。 | DesktopRegistration | 您指定的任何可執行檔都必須位於遊戲基底資料夾中的 "Installers" 資料夾下。請勿在 Installers 資料夾中包含任何其他檔案。 |
| [Folder](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-folder) | 選用 (僅限 PC Desktop) | 指定安裝程式的資料夾位置。 | CustomInstallActions | |
| [InstallActionList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-installactionlist) | 選用 (僅限 PC Desktop) | 指定安裝動作的清單，包括可執行檔、名稱和引數。 | CustomInstallActions | |
| [InstallAction](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-installaction) | 選用 (僅限 PC Desktop) | 指定 Install Action List 中的安裝動作。 | InstallActionList | 最多 100 個項目。 |
| [RepairActionList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-repairactionlist) | 選用 (僅限 PC Desktop) | 指定修復動作的清單。 | CustomInstallActions | |
| [RepairAction](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-repairaction) | 選用 (僅限 PC Desktop) | 指定 Repair Action List 中的修復動作。 | RepairActionList | 最多 100 個項目。 |
| [UninstallActionList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-uninstallactionlist) | 選用 (僅限 PC Desktop) | 指定解除安裝動作的清單。 | CustomInstallActions | |
| [UninstallAction](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-uninstallaction) | 選用 (僅限 PC Desktop) | 指定 Uninstall Action List 中的解除安裝動作。 | UninstallActionList | 最多 100 個項目。 |
| [ModFolder](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-modfolder) | 選用 (僅限 PC Desktop) | 定義遊戲檔案之使用者模組的位置。 | DesktopRegistration | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，此元素已被取代。 |
| <a id="MGC-RegistryVirtualization" /> [DisableRegistryWriteVirtualization](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-disableregistrywritevirtualization) | 選用 (僅限 PC Desktop) | 若您的遊戲必須進行作業系統全域的登錄寫入，請設定為 true。 | DesktopRegistration | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，此元素已被取代。 |
| <a id="MGC-FileSystemVirtualization" /> [DisableFilesystemWriteVirtualization](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-disablefilesystemwritevirtualization) | 選用 (僅限 PC Desktop) | 若您的遊戲必須進行作業系統全域的檔案寫入，請設定為 true。 | DesktopRegistration | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，此元素已被取代。 |
| <a id="MGC-PackageRootWrites" /> [EnableWritesToPackageRoot](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-enablewritestopackageroot) | 選用 (僅限 PC Desktop) | 若您的遊戲需要寫入套件安裝位置，請設定為 true。 | DesktopRegistration | 自 2022 年 3 月 Microsoft Game Development Kit (GDK) 起，此元素已被取代。 |
| <a id="MGC-MultiplayerProtocol" /> [MultiplayerProtocol](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-multiplayerprotocol) | 選用 (僅限 PC Desktop) | 允許透過 "ms-xbl-multiplayer" 通訊協定在遊戲內進行通訊協定啟用。 | DesktopRegistration | 主要用於讓 XBOX Game Bar 能夠啟動遊戲/多人遊戲邀請。 |
| <a id="MGC-FileTypeAssociation" /> [FileTypeAssociation](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-filetypeassociation) | 選用 (僅限 PC Desktop) | 允許將檔案類型與套件中的可執行檔建立關聯。 | DesktopRegistration | 例如遊戲地圖編輯器的特定副檔名。如需詳細資訊，請參閱[檔案類型啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)。 |
| [DisplayName](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-displayname) | 選用 (僅限 PC Desktop) | 指定檔案類型關聯的顯示名稱。 | FileTypeAssociation | |
| [Logo](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-logo) | 選用 (僅限 PC Desktop) | 指定檔案類型關聯的標誌。 | FileTypeAssociation | |
| [InfoTip](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-infotip) | 選用 (僅限 PC Desktop) | 指定檔案類型關聯的資訊提示。 | FileTypeAssociation | |
| [EditFlags](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-editflags) | 選用 (僅限 PC Desktop) | 指定檔案類型關聯的編輯旗標。 | FileTypeAssociation | |
| [SupportedFileTypes](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-supportedfiletypes) | 選用 (僅限 PC Desktop) | 指定檔案類型關聯支援的檔案類型。 | FileTypeAssociation | 如需詳細資訊，請參閱[檔案類型啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)。 |
| [FileType](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-filetype) | 選用 (僅限 PC Desktop) | 指定要作為 SupportedFileTypes 元素一部分使用的副檔名。 | SupportedFileTypes | 如需詳細資訊，請參閱[檔案類型啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)。 |
| [NoCodePCRoot](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-nocodepcroot) | 選用 (僅限 PC Desktop) | 指定在套件啟用無程式碼雲端存檔時，用來儲存遊戲存檔的本機資料夾。 | SaveGameStorage | |
| <a id="MGC-DevelopmentOnly" /> [DevelopmentOnly](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-developmentonly) | 選用 (僅限主機) | 僅限開發用的屬性清單。 | Game | |
| [ContentIdOverride](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-contentidoverride) | 選用 (僅限主機) | 僅限開發用、對遊戲 ContentID 的覆寫。 | DevelopmentOnly | 在已安裝套件的情況下，使用 <i>xbapp list /d /nosystem</i> 命令來取得遊戲的 ContentID。 |
| [EKBIDOverride](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-ekbidoverride) | 選用 (僅限主機) | 僅限開發用、對遊戲 EKBID (試用版識別碼) 的覆寫。 | DevelopmentOnly | 在已安裝套件的情況下，使用 <i>xbapp list /d</i> 命令來取得遊戲的 EKBID。 |
| [DebugNetworkPortList](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-debugnetworkportlist) | 選用 (僅限主機) | 在開發套件上為開發而開啟之其他連接埠的清單。 | DevelopmentOnly | |
| [DebugNetworkPort](/zh-TW/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-debugnetworkport) | 選用 (僅限主機) | 在開發套件上為開發而開啟的其他連接埠。 | DebugNetworkPortList | |

[返回本文頂端。](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema)

## 錯誤碼

使用 MicrosoftGame.config 檔案時，可能會遇到下列錯誤碼。如需完整清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

| 代碼 | 值 | 描述 |
| - | - | - |
| E\_GAME\_MISSING\_GAME\_CONFIG | 0x87e5001F | 此應用程式缺少必要的 MicrosoftGame.Config 檔案。 |
| E\_GAMERUNTIME\_OPTIONS\_NOT\_SUPPORTED | 0x8924010A | 傳遞的選項與遊戲的套件不相容。遊戲設定資訊必須與套件相符。 |
| E\_GAMERUNTIME\_GAMECONFIG\_BAD\_FORMAT | 0x8924010B | 無法剖析傳遞給 Initialize 的遊戲設定。 |
| E\_GAMEUSER\_NO\_TITLE\_ID | 0x89245108 | 必須設定 XBOX Live TitleId。 |
| E\_GAMEUSER\_UNKNOWN\_GAME\_IDENTITY | 0x89245109 | 無法辨識遊戲身分識別。MSAAppId 和 TitleId 與遊戲相關聯的值不符。 |
| E\_GAMEUSER\_INVALID\_APP\_CONFIGURATION | 0x89245112 | 遊戲設定中的 MSAAppId 無效，或未針對驗證堆疊進行設定。 |
| E\_GAMEUSER\_MALFORMED\_MSAAPPID | 0x89245113 | 遊戲設定中的 MSAAppId 不符合預期的格式 (16 個字元的字串或 GUID)。 |
| E\_GAMEUSER\_INCONSISTENT\_MSAAPPID\_AND\_TITLEID | 0x89245114 | 遊戲設定中的 MSAAppId 和 TitleId 與遊戲相關聯的值不符。 |
| E\_GAMEPACKAGE\_NO\_STORE\_ID | 0x89245202 | 必須在應用程式的遊戲設定中設定 StoreId 屬性。 |
| E\_GAMEPACKAGE\_DLC\_NOT\_SUPPORTED | 0x89245206 | 遊戲不支援此 DLC 套件。請確認遊戲設定中的 DLC 相容性正確。 |
| E\_GAMEPACKAGE\_DUPLICATE\_ID\_VALUES | 0x89245207 | 套件包含多個對應至相同 'ID' 屬性的可執行檔。請檢查 'Executable' 元素中是否有重複的 'ID' 屬性。 |
| E\_GAMEPACKAGE\_CONFIG\_NO\_ROOT\_NODE | 0x89245209 | 在 MicrosoftGame.config 檔案中找不到根 \<Game> 節點。請檢查檔案格式是否正確。 |
| E\_GAMEPACKAGE\_CONFIG\_ZERO\_VERSION | 0x8924520A | MicrosoftGame.config 中 'Identity' 節點的 'Version' 屬性不能是 0.0.0.0。請遞增或移除此屬性。若未指定版本，預設值為 1.0.0.0。 |
| E\_GAMEPACKAGE\_CONFIG\_NO\_MSAAPPID\_NOTITLEID | 0x8924520B | MicrosoftGame.config 中缺少 'MSAAppId' 或 'TitleId' 元素。使用 configVersion >= 1 時，兩者都必須指定。 |
| E\_GAMEPACKAGE\_CONFIG\_DEPRECATED\_PC\_ENTRIES | 0x8924520C | DesktopRegistration 項目 "modFolder"、"enableWritesToPackageRoot"、"disableRegistryWriteVirtualization" 和 "disableFilesystemWriteVirtualization" 在 configVersion >= 1 中已被取代。 |
| E\_GAMEPACKAGE\_CONFIG\_SUM\_REQUIRES\_MSAAPPID | 0x8924520D | 使用簡化使用者模型 (AdvancedUserModel 元素) 且 configVersion >= 1 時，'MSAAppId' 和 'TitleId' 元素為必要。 |
| E\_GAMEPACKAGE\_CONFIG\_NO\_CODE\_CLOUD\_SAVES\_REQUIRES\_MSAAPPID | 0x8924520E | 使用無程式碼雲端存檔 (NoCodePCRoot 元素) 且 configVersion >= 1 時，'MSAAppId' 和 'TitleId' 元素為必要。 |
| E\_GAMEPACKAGE\_CONFIG\_MSAAPPID\_OR\_TITLEID\_IS\_DEFAULT | 0x8924520F | 'MSAAppId' 或 'TitleId' 元素為預設值。使用 configVersion >= 1 時，若指定了 NoCodePCRoot 或 AdvancedUserModel，TitleId 和 MSAAppId 都必須是來自 Partner Center 的有效識別碼。 |

<a id="MicrosoftGameConfig-Example" />

## 範例 MicrosoftGame.config 檔案

下列 MicrosoftGame.config 是一個範例設定，示範如何在 XBOX Series X|S 中使用元素 (並以註解說明與 XBOX One 的差異)。如需適用於 PC 的 MicrosoftGame.config 範例，請參閱[開始使用 PC 封裝](/zh-TW/build/core-features/common/packaging/overviews/packaging-getting-started-for-PC)。

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="1">
    
    <Identity Name="41336PublisherName.ExampleGame" Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1" Version="1.6.0.0"/>
    
    <GameOsVersion>**REPLACE**</GameOsVersion>
    
    <MediaCapture>
        <GameDVRSystemComponent>true</GameDVRSystemComponent>
        <BlockBroadcast>0</BlockBroadcast>
        <BlockGameDVR>0</BlockGameDVR>
    </MediaCapture>
    
    <PersistentLocalStorage>
        <SizeMB>322</SizeMB>
    </PersistentLocalStorage>
    
    <MSAAppId>0000000000000000</MSAAppId>

    <TitleId>FFFFFFFF</TitleId>

    <StoreId>9NZTKMP36L8J</StoreId>
    
    <RelatedProducts>
        <RelatedProduct>9NZTKMP36L8J</RelatedProduct>
        <RelatedProduct>9NQJV5BMKR6C</RelatedProduct>
        <RelatedProduct>9PNX38847DWW</RelatedProduct>
    </RelatedProducts>
    
    <VirtualMachine>
        <XboxLockhartTitleMemory>Standard</XboxLockhartTitleMemory>
        <XboxAnacondaTitleMemory>Standard</XboxAnacondaTitleMemory>
        <!-- <XboxOneXTitleMemory>Standard</XboxOneXTitleMemory> if MicrosoftGame.config is for Xbox One instead of Xbox Series X&#124;S. -->
    </VirtualMachine>
    
    <MSAFullTrust>false</MSAFullTrust>
    
    <ExecutableList>
         <!-- TargetDeviceFamily="XboxOne" if the MicrosoftGame.config is for Xbox One instead of Xbox Series X&#124;S. -->
        <Executable Name="ExampleGame.exe"
            TargetDeviceFamily="Scarlett"
            Id="Game"
            IsDevOnly="false"
            OverrideDisplayName="Example Game"
            OverrideLogo="OverriddenLogo.png" />
        <Executable Name="ExampleGame_Debug.exe"
            IsDevOnly="true"/>
        <Executable Name="ExampleGame_Profile.exe"
            IsDevOnly="true" />
    </ExecutableList>
    
    <ShellVisuals DefaultDisplayName="Example Game"
        PublisherDisplayName="Example Publisher"
        StoreLogo="StoreLogoFile.png"
        Square150x150Logo="LogoFile150x150.png"
        Square44x44Logo="LogoFile44x44.png"
        Square480x480Logo="LogoFile480x480.png"
        Description="Example Game"
        ForegroundText="light"
        BackgroundColor="#ffffff"
        SplashScreenImage="SplashScreen.png"/>
    
    <Resources>
        <Resource Language="en-us"/>
        <Resource Language="de-de"/>
        <Resource Language="es-mx"/>
    </Resources>

    <DevelopmentOnly>
      <DebugNetworkPortList>
        <DebugNetworkPort>4600</DebugNetworkPort>
      </DebugNetworkPortList>
    </DevelopmentOnly>
</Game>
```

[返回本文頂端。](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema)

<a id="XSD-Schema-id" />

## MicrosoftGame.config 的 XSD 結構描述

MicrosoftGame.config 檔案的最新結構描述位於 Microsoft Game Development Kit (GDK) 安裝的 \<install root>/bin 資料夾中，名稱為 GameConfigSchema.xsd。

請參閱下列 GameConfigSchema.xsd 範例：

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Types -->

    <xs:simpleType name="ST_NonEmptyString">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="32767"/>
            <xs:pattern value="[^\s]|([^\s].*[^\s])"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_GUID">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_VersionQuad">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_Hex8">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[0-9a-fA-F]{8}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_Hex16">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[0-9a-fA-F]{16}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_PLSSize">
        <xs:restriction base="xs:integer">
            <!-- The actual max is determined by policy -->
            <xs:maxInclusive value="100000"/>
            <xs:minInclusive value="10"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_GrowablePLSSize">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="10"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_PersistentLocalStorage">
        <xs:all>
            <xs:element name="SizeMB" type="ST_PLSSize" minOccurs="0" maxOccurs="1"/>
            <xs:element name="GrowableToMB" type="ST_GrowablePLSSize" minOccurs="0" maxOccurs="1"/>
        </xs:all>
    </xs:complexType>

    <xs:simpleType name="ST_FileNameCharSet">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[^&lt;&gt;&quot;:%\|\?\*\x01-\x1f]+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_FileName">
        <xs:restriction base="ST_FileNameCharSet">
            <xs:pattern value="([^/\\]*[^./\\]+)(\\[^/\\]*[^./\\]+)*"/>
            <xs:pattern value="([^/\\]*[^./\\]+)(/[^/\\]*[^./\\]+)*"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_FileNameNoPath">
        <xs:restriction base="ST_FileName">
            <xs:pattern value="[^\\/]+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_AsciiWindowsId">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="([A-Za-z][A-Za-z0-9]*)(\.[A-Za-z][A-Za-z0-9]*)*"/>
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_DeviceFamily">
        <xs:restriction base="xs:string">
            <xs:enumeration value="XboxOne"/>
            <xs:enumeration value="Scarlett"/>
            <xs:enumeration value="PC"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ApplicationId">
        <xs:restriction base="ST_AsciiWindowsId">
            <xs:maxLength value="64"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_StoreId">
        <xs:restriction base="xs:string">
            <xs:minLength value="12"/>
            <xs:maxLength value="12"/>
            <xs:pattern value="[0-9bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ]{12}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_Executable">
        <xs:restriction base="ST_FileName">
            <xs:pattern value=".+\.([Ee][Xx][Ee])"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ExecutableNoPath">
        <xs:restriction base="ST_FileName">
            <xs:pattern value="[^\\]+\.([Ee][Xx][Ee])"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ImageFile">
        <xs:restriction base="ST_FileName">
            <xs:pattern value=".+\.(png)"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ResourceReference">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="\bms-resource:.{1,256}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_DisplayName">
        <xs:union memberTypes="ST_ResourceReference">
            <xs:simpleType>
                <xs:restriction base="ST_NonEmptyString">
                    <xs:maxLength value="256"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>

    <xs:simpleType name="ST_Description">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[^\x01-\x1f]+"/>
            <xs:maxLength value="2048"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ForegroundText">
        <xs:restriction base="xs:string">
            <xs:enumeration value="light"/>
            <xs:enumeration value="dark"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_Color">
        <xs:restriction base="xs:string">
            <xs:pattern value="#[\da-fA-F]{6}"/>
            <xs:pattern value="aliceBlue|antiqueWhite|aqua|aquamarine|azure|beige|bisque|black|blanchedAlmond|blue|blueViolet|brown|burlyWood"/>
            <xs:pattern value="cadetBlue|chartreuse|chocolate|coral|cornflowerBlue|cornsilk|crimson|cyan|darkBlue|darkCyan|darkGoldenrod|darkGray"/>
            <xs:pattern value="darkGreen|darkKhaki|darkMagenta|darkOliveGreen|darkOrange|darkOrchid|darkRed|darkSalmon|darkSeaGreen|darkSlateBlue"/>
            <xs:pattern value="darkSlateGray|darkTurquoise|darkViolet|deepPink|deepSkyBlue|dimGray|dodgerBlue|firebrick|floralWhite|forestGreen"/>
            <xs:pattern value="fuchsia|gainsboro|ghostWhite|gold|goldenrod|gray|green|greenYellow|honeydew|hotPink|indianRed|indigo|ivory"/>
            <xs:pattern value="khaki|lavender|lavenderBlush|lawnGreen|lemonChiffon|lightBlue|lightCoral|lightCyan|lightGoldenrodYellow|lightGreen"/>
            <xs:pattern value="lightGray|lightPink|lightSalmon|lightSeaGreen|lightSkyBlue|lightSlateGray|lightSteelBlue|lightYellow|lime|limeGreen"/>
            <xs:pattern value="linen|magenta|maroon|mediumAquamarine|mediumBlue|mediumOrchid|mediumPurple|mediumSeaGreen|mediumSlateBlue|mediumSpringGreen"/>
            <xs:pattern value="mediumTurquoise|mediumVioletRed|midnightBlue|mintCream|mistyRose|moccasin|navajoWhite|navy|oldLace|olive|oliveDrab"/>
            <xs:pattern value="orange|orangeRed|orchid|paleGoldenrod|paleGreen|paleTurquoise|paleVioletRed|papayaWhip|peachPuff|peru|pink|plum"/>
            <xs:pattern value="powderBlue|purple|red|rosyBrown|royalBlue|saddleBrown|salmon|sandyBrown|seaGreen|seaShell|sienna|silver|skyBlue"/>
            <xs:pattern value="slateBlue|slateGray|snow|springGreen|steelBlue|tan|teal|thistle|tomato|transparent|turquoise|violet|wheat|white"/>
            <xs:pattern value="whiteSmoke|yellow|yellowGreen"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_Resources">
        <xs:sequence>
            <xs:element name="Resource" maxOccurs="200" minOccurs="0" >
                <xs:complexType>
                    <xs:attribute name="Language" type="xs:language" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

     <xs:complexType name="CT_Identity">
        <xs:attribute name="Name" type="ST_PackageName" use="required"/>
        <xs:attribute name="Publisher" type="ST_Publisher" use="required"/>
        <xs:attribute name="ResourceId" type="ST_ResourceId" use="optional"/>
        <xs:attribute name="Version" type="ST_VersionQuad" use="optional"/>
    </xs:complexType>

    <xs:complexType name="CT_ShellVisuals">
        <xs:attribute name="DefaultDisplayName" type="ST_DisplayName" use="optional"/>
        <xs:attribute name="PublisherDisplayName" type="ST_DisplayName" use="optional"/>
        <xs:attribute name="StoreLogo" type="ST_ImageFile" use="optional"/>
        <xs:attribute name="Square150x150Logo" type="ST_ImageFile" use="optional"/>
        <xs:attribute name="Square44x44Logo" type="ST_ImageFile" use="optional"/>
        <xs:attribute name="Square480x480Logo" type="ST_ImageFile" use="optional"/>
        <xs:attribute name="Description" type="ST_Description" use="optional"/>
        <xs:attribute name="ForegroundText" type="ST_ForegroundText" use="optional"/>
        <xs:attribute name="BackgroundColor" type="ST_Color" use="optional"/>
        <xs:attribute name="SplashScreenImage" type="ST_ImageFile" use="optional"/>
    </xs:complexType>

    <xs:simpleType name="ST_MemoryConfig">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Standard"/>
            <xs:enumeration value="Advanced"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ConsoleGeneration">
        <xs:restriction base="xs:string">
            <xs:enumeration value="XboxOne"/>
            <xs:enumeration value="Scarlett"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_VirtualMachine">
        <xs:all>
            <xs:element name="XboxOneXTitleMemory" type="ST_MemoryConfig" minOccurs="0"/>
            <xs:element name="XboxAnacondaTitleMemory" type="ST_MemoryConfig" minOccurs="0"/>
            <xs:element name="SMTEnabled" type="xs:boolean" minOccurs="0"/>
            <xs:element name="RequiresEraShim" type="xs:boolean" minOccurs="0"/>
            <xs:element name="XboxCompatibility" type="ST_ConsoleGeneration" minOccurs="0"/>
            <xs:element name="DlcCompatibility" type="ST_ConsoleGeneration" minOccurs="0"/>
            <xs:element name="XboxLockhartTitleMemory" type="ST_MemoryConfig" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="CT_DesktopRegistration">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="ProcessorArchitecture" type="ST_ProcessorArchitecture" minOccurs="0"/>
            <xs:element name="MainPackageDependency " minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_PackageName"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="DependencyList" type="CT_DependencyList" minOccurs="0"/>
            <xs:element name="CustomInstallActions" type="CT_CustomInstallActions" minOccurs="0"/>
            <xs:element name="ModFolder" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_FileNameNoPath" use="optional"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="DisableRegistryWriteVirtualization" type="xs:boolean" minOccurs="0"/>
            <xs:element name="DisableFilesystemWriteVirtualization" type="xs:boolean" minOccurs="0"/>
            <xs:element name="EnableWritesToPackageRoot" type="xs:boolean" minOccurs="0"/>
            <xs:element name="MultiplayerProtocol" minOccurs="0">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:boolean">
                            <xs:attribute name="Executable" type="ST_Executable"  use="optional"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="FileTypeAssociation" type="CT_FileTypeAssociation" minOccurs="0" maxOccurs="100"/>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="ST_KnownDependency">
        <xs:restriction base="xs:string">
            <xs:enumeration value="DX11"/>
            <xs:enumeration value="VC11"/>
            <xs:enumeration value="VC12"/>
            <xs:enumeration value="VC14"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ProcessorArchitecture">
        <xs:restriction base="xs:string">
            <xs:enumeration value="x64"/>
            <xs:enumeration value="x86"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_DependencyList">
        <xs:sequence maxOccurs="128" minOccurs="0">
            <xs:element name="KnownDependency" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_KnownDependency" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="Dependency" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_PackageName" use="required"/>
                    <xs:attribute name="MinVersion" type="ST_VersionQuad" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_CustomInstallAction">
        <xs:attribute name="File" type="ST_FileName" use="required"/>
        <xs:attribute name="Name" type="ST_NonEmptyString" use="required"/>
        <xs:attribute name="Arguments" type="ST_NonEmptyString" />
    </xs:complexType>

    <xs:complexType name="CT_InstallActionList">
        <xs:sequence maxOccurs="100" minOccurs="0">
            <xs:element name="InstallAction" type="CT_CustomInstallAction" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_RepairActionList">
        <xs:sequence maxOccurs="100" minOccurs="0">
            <xs:element name="RepairAction" type="CT_CustomInstallAction" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_UninstallActionList">
        <xs:sequence maxOccurs="100" minOccurs="0">
            <xs:element name="UninstallAction" type="CT_CustomInstallAction" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_CustomInstallActions">
        <xs:all>
            <xs:element name="Folder" type="ST_FileName" minOccurs="1"/>
            <xs:element name="InstallActionList" type="CT_InstallActionList" minOccurs="0"/>
            <xs:element name="RepairActionList" type="CT_RepairActionList" minOccurs="0"/>
            <xs:element name="UninstallActionList" type="CT_UninstallActionList" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="CT_ExecutableList">
        <xs:sequence maxOccurs="unbounded" minOccurs="0">
            <xs:element name="Executable">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_Executable" use="required"/>
                    <xs:attribute name="TargetDeviceFamily" type="ST_DeviceFamily" use="optional"/>
                    <xs:attribute name="Id" type="ST_ApplicationId" use="optional"/>
                    <xs:attribute name="IsDevOnly" type="xs:boolean" use="optional"/>
                    <xs:attribute name="OverrideDisplayName" type="ST_DisplayName" use="optional"/>
                    <xs:attribute name="OverrideLogo" type="ST_ImageFile" use="optional"/>
                    <xs:attribute name="OverrideSquare480x480Logo" type="ST_ImageFile" use="optional"/>
                    <xs:attribute name="OverrideSquare44x44Logo" type="ST_ImageFile" use="optional"/>
                    <xs:attribute name="OverrideSplashScreenImage" type="ST_ImageFile" use="optional"/>
                    <xs:attribute name="Alias" type="ST_ExecutableNoPath" use="optional"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_AllowedProductsList">
        <xs:sequence maxOccurs="unbounded" minOccurs="0">
            <xs:element name="AllowedProduct" type="ST_StoreId"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_PublisherContent">
        <xs:all>
            <xs:element name="ManifestUrl" type="xs:anyURI" minOccurs="1"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="CT_ExtendedAttributeList">
        <xs:sequence maxOccurs="unbounded" minOccurs="0">
            <xs:element name="ExtendedAttribute">
                <xs:complexType>
                    <xs:attribute name="Name" type="ST_NonEmptyString" use="optional"/>
                    <xs:attribute name="Value" type="ST_NonEmptyString" use="optional"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_RelatedProductsList">
        <xs:sequence maxOccurs="unbounded" minOccurs="0">
            <xs:element name="RelatedProduct" type="ST_StoreId"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_MediaCapture">
        <xs:all>
            <xs:element name="GameDVRSystemComponent" type="xs:boolean" minOccurs="0"/>
            <xs:element name="BlockBroadcast" type="xs:boolean" minOccurs="0"/>
            <xs:element name="BlockGameDVR" type="xs:boolean" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:simpleType name="ST_AllowedAsciiCharSet">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[-_. A-Za-z0-9]+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_AsciiIdentifier">
        <xs:restriction base="ST_AllowedAsciiCharSet">
            <xs:pattern value="[^_ ]+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_PackageName">
        <xs:restriction base="ST_AsciiIdentifier">
            <xs:minLength value="3"/>
            <xs:maxLength value="50"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_DistinguishedName">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="(CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+=&quot;&lt;&gt;#;])+|&quot;.*&quot;)(, ((CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+=&quot;&lt;&gt;#;])+|&quot;.*&quot;)))*"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_Publisher">
        <xs:restriction base="ST_DistinguishedName">
            <xs:maxLength value="8192"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ResourceId">
        <xs:restriction base="ST_AsciiIdentifier">
            <xs:maxLength value="30"/>
        </xs:restriction>
  </xs:simpleType>

    <xs:simpleType name="ST_Port">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[1-9][0-9]{0,4}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_DebugNetworkPortList">
        <xs:sequence maxOccurs="unbounded" minOccurs="0">
            <xs:element name="DebugNetworkPort" type="ST_Port"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CT_DevelopmentOnly">
      <xs:all>
        <xs:element name="ContentIdOverride" type="ST_GUID" minOccurs="0"/>
        <xs:element name="EKBIDOverride" type="ST_GUID" minOccurs="0"/>
        <xs:element name="DebugNetworkPortList" type="CT_DebugNetworkPortList" minOccurs="0"/>
      </xs:all>
    </xs:complexType>

    <xs:simpleType name="ST_FTAInfoTip">
        <xs:restriction base="ST_NonEmptyString">
            <xs:maxLength value="1024"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ContentTypeCharSet">
        <xs:restriction base="ST_NonEmptyString">
            <xs:pattern value="[!#$%&amp;'*+-.^_`|~0-9a-z/]*"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_ContentType">
        <xs:restriction base="ST_ContentTypeCharSet">
            <xs:pattern value="[^/]{1,127}/[^/]{1,127}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_FileType">
        <xs:restriction base="ST_FileNameCharSet">
            <xs:pattern value="\.[^.\\]+"/>
            <xs:maxLength value="64"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_FTASupportedFileTypes">
        <xs:sequence>
            <xs:element name="FileType" maxOccurs="1000" >
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="ST_FileType">
                            <xs:attribute name="ContentType" type="ST_ContentType" use="optional"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="ST_FTAName">
        <xs:restriction base="ST_AllowedAsciiCharSet">
            <xs:pattern value="[^ A-Z]+"/>
            <xs:maxLength value="100"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_FileTypeAssociation">
        <xs:all>
            <xs:element name="DisplayName" type="ST_DisplayName" minOccurs="0"/>
            <xs:element name="Logo" type="ST_ImageFile" minOccurs="0"/>
            <xs:element name="InfoTip" type="ST_FTAInfoTip" minOccurs="0"/>
            <xs:element name="EditFlags" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="OpenIsSafe" type="xs:boolean" use="optional"/>
                    <xs:attribute name="AlwaysUnsafe" type="xs:boolean" use="optional"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SupportedFileTypes" type="CT_FTASupportedFileTypes"/>
        </xs:all>
        <xs:attribute name="Name" type="ST_FTAName" use="required"/>
        <xs:attribute name="Executable" type="ST_Executable"  use="optional"/>
    </xs:complexType>

    <xs:simpleType name="ST_GameSaveNoCodePcRootRelativeLocation">
        <xs:restriction base="xs:string">
            <xs:enumeration value="AppData"/>
            <xs:enumeration value="Public"/>
            <xs:enumeration value="LocalAppData"/>
            <xs:enumeration value="LocalAppDataLow"/>
            <xs:enumeration value="ProgramData"/>
            <xs:enumeration value="SavedGames"/>
            <xs:enumeration value="UserProfile"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ST_GameSaveUserQuotaSize">
        <xs:restriction base="xs:integer">
            <xs:maxInclusive value="4096"/>
            <xs:minInclusive value="256"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="CT_SaveGameStorage">
        <xs:all>
            <xs:element name="NoCodePCRoot" minOccurs="0">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="ST_FileName">
                            <xs:attribute name="RelativeTo" type="ST_GameSaveNoCodePcRootRelativeLocation" use="required"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="SCID" type="ST_GUID" minOccurs="0"/>
            <xs:element name="MaxUserQuota" type="ST_GameSaveUserQuotaSize" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <!-- Root -->
    <xs:element name="Game">
        <xs:complexType>
            <xs:all>
                <xs:element name="Identity" type="CT_Identity" />
                <xs:element name="ShellVisuals" type="CT_ShellVisuals" minOccurs="0"/>
                <xs:element name="Resources" type="CT_Resources" minOccurs="0"/>
                <xs:element name="ExecutableList" type="CT_ExecutableList" minOccurs="0"/>
                <xs:element name="GameOsVersion" type="ST_VersionQuad" minOccurs="0"/>
                <xs:element name="MediaCapture" type="CT_MediaCapture" minOccurs="0"/>
                <xs:element name="StoreId" type="ST_StoreId" minOccurs="0" />
                <xs:element name="TargetDeviceFamilyForDLC" type="ST_DeviceFamily" minOccurs="0"/>
                <xs:element name="AllowedProducts" type="CT_AllowedProductsList" minOccurs="0"/>
                <xs:element name="RelatedProducts" type="CT_RelatedProductsList" minOccurs="0"/>
                <xs:element name="PersistentLocalStorage" type="CT_PersistentLocalStorage" minOccurs="0"/>
                <xs:element name="VirtualMachine" type="CT_VirtualMachine" minOccurs="0"/>
                <xs:element name="MSAFullTrust" type="xs:boolean" minOccurs="0"/>
                <xs:element name="MSAAppId" type="ST_NonEmptyString" minOccurs="0"/>
                <xs:element name="TitleId" type="ST_Hex8" minOccurs="0"/>
                <xs:element name="RequiresXboxLive" type="xs:boolean" minOccurs="0"/>
                <xs:element name="ExtendedAttributeList" type="CT_ExtendedAttributeList" minOccurs="0"/>
                <xs:element name="DesktopRegistration" type="CT_DesktopRegistration" minOccurs="0"/>
                <xs:element name="DevelopmentOnly" type="CT_DevelopmentOnly" minOccurs="0"/>
                <xs:element name="AdvancedUserModel" type="xs:boolean" default="true" minOccurs="0" maxOccurs="1" />
                <xs:element name="SaveGameStorage" type="CT_SaveGameStorage" minOccurs="0"/>
                <xs:element name="PublisherContentBaseProduct" type="ST_StoreId" minOccurs="0" maxOccurs="1"/>
                <xs:element name="PublisherContent" type="CT_PublisherContent" minOccurs="0" maxOccurs="1"/>
            </xs:all>
            <xs:attribute name="configVersion" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:integer">
                        <xs:maxInclusive value="1"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
        <xs:unique name="Resource_Language">
            <xs:selector xpath="Resources/Resource"/>
            <xs:field xpath="@Language"/>
        </xs:unique>
    </xs:element>
</xs:schema>
```

[返回本文頂端。](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema)

<a id="MicrosoftGameConfig-OldElements" />

## 先前的元素參考

* PrimaryServiceConfig 是 XBOX One ERA AppxManifest.xml 中用來定義 SCID 呼叫的元素。現在改為在程式碼中定義，並在 DevCenter 中設定。
* VisualElements 是 XBOX One ERA AppxManifest.xml 中用來定義市集標誌及遊戲其他視覺層面的元素。現在改為在 ShellVisuals 中定義。
* GpuAvailability 是 XBOX One ERA AppxManifest.xml 中用來定義 GPU 可用性的元素。現在會自動完成，因為所有 Microsoft Game Development Kit (GDK) 遊戲都會自動取得可變設定 (盡可能多的 GPU)。
* ConnectedStorageQuota 是 XBOX One ERA AppxManifest.xml 中用來定義連線儲存體大小的元素。現在改由伺服器端設定決定。
* LicenseOverrides 是 XBOX One ERA debug\_licensing\_overrides.xml 中用來定義 ContentID、ProductID 和 EKBID 覆寫的元素。現在改為直接在 MicrosoftGame.config 中透過 ContentIDOverride、StoreId 和 EKBIDOverride 元素進行管理。
* NetworkManifest 元素是在先前版本的 MicrosoftGame.config 中定義的。除了 DebugNetworkPortList 元素以外，現在改為透過現有的網路 API 完成。
* XboxOneTitleMemoryMaxMB 和 XboxOneXTitleMemoryMaxMB 是先前版本 MicrosoftGame.config 中使用的元素。XboxOneTitleMemoryMaxMB 已無法再設定，而 XBOX One X 和 XBOX Series S|X 用於遊戲記憶體設定的元素現在是 XboxOneXTitleMemory、XboxLockhartTitleMemory 和 XboxAnacondaTitleMemory。
* packageWriteRedirectionCompatibilityShim 先前是一個 ExtendedAttribute 值，用於在 2020 年 5 月 GDK 之前啟用此功能。自 2020 年 5 月 GDK 起，此功能現在以其專屬元素 EnableWritesToPackageRoot 進行追蹤。

[返回本文頂端。](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema)

<a id="MicrosoftGameConfig-Capabilities" />

## 受限制的功能設定

在 Microsoft Game Development Kit (GDK) 中，受限制的功能是透過 MicrosoftGame.config 元素進行設定。常用功能的對應如下。

* runFullTrust 功能預設設定為啟用。
* customInstallActions 功能由 CustomInstallActions 元素設定。

受限制的功能需要以電子郵件聯絡您的客戶經理，以確保已啟用這些功能的權限 (除了正確更新您的 MicrosoftGame.config 之外，這也是必要的)。如需這些功能的詳細資訊，以及如何設定 MicrosoftGame.config 以在您的 PC 遊戲中使用這些功能，請參閱[開始使用 PC 遊戲封裝](/zh-TW/build/core-features/common/packaging/overviews/packaging-getting-started-for-PC)。

<a id="MicrosoftGameConfig-DLC" />

## 作為 DLC 套件建立一部分的 MicrosoftGame.config

如需如何為 DLC 套件產生 MicrosoftGame.config 的詳細資訊，請參閱[可下載內容 (DLC) 套件](/zh-TW/build/core-features/common/packaging/packaging-downloadable-content-dlc)。

[返回本文頂端。](/zh-TW/reference/system/microsoftgameconfig/microsoftgameconfig-schema)

<a id="MicrosoftGameConfig-SeeAlso" />

## 另請參閱

[MicrosoftGame.config 元素參考](/zh-TW/reference/system/microsoftgameconfig/elements/gc-microsoftgameconfig-toc)\
[MicrosoftGame.Config](/zh-TW/build/core-features/common/game-config/MicrosoftGameConfig-toc)\
[MicrosoftGame.Config 概觀](/zh-TW/build/core-features/common/game-config/MicrosoftGameConfig-Overview)\
[MicrosoftGame.Config 當地語系化](/zh-TW/build/core-features/common/game-config/MicrosoftGameConfig-Localization)\
[封裝概觀](/zh-TW/build/core-features/common/packaging/overviews/packaging)\
[PC 啟動載入器](/zh-TW/build/gdk-and-engines/guides/pc-bootstrapper)


## Related topics

- [MicrosoftGame.config Element - Game](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-game.md)
- [MicrosoftGame.config 编辑器](/zh-CN/build/core-features/common/game-config/MicrosoftGameConfig-Editor.md)
- [MicrosoftGame.config 元素 - Shareable](/zh-CN/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-shareable.md)
- [MicrosoftGame.config 概述](/zh-CN/build/core-features/common/game-config/MicrosoftGameConfig-Overview.md)
- [MicrosoftGame.config 附加参考](/zh-CN/reference/system/microsoftgameconfig/microsoftgameconfig-schema.md)
