> ## 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.

# Submission Validator 品質檢查

> Submission Validator 品質檢查

Submission Validator 識別的問題類型會隨著時間成長和演進。目標是讓從提交、認證到上市的過程更加順暢。

Submission Validator 會執行下列品質檢查：

* [可用版本](#ID4EY)
* [核准的 GDK 版本](#ID4AGDK)
* [核准的 Game OS](#ID4EKB)
* [內容 (可下載內容 (DLC)) 最後區塊中的啟動標記](#ID4EHD)
* [額外的 Resources.pri 檔案](#ID4EDE)
* [遺失 Resources.pri 檔案](#ID4ERF)
* [每個套件一個應用程式](#ID4EBBAC)
* [套件大小上限](#ID4E3BAC)
* [外來檔案](#ID4EDCAC)
* [二進位檔掃描](#ID4EEEAC)
* [Microsoft (MS) 元件版本](#ID4ESFAC)
* [遺失相依檔案](#ID4MDF)
* [ARM64 二進位檔](#IDDKDF)

<a id="ID4EY" />

## 可用版本

Submission Validator 會檢查以確保您安裝的版本是最新且正確的版本。如果不是，Submission Validator 輸出記錄會顯示失敗。下一節所示的失敗訊息包含可下載正確版本的連結。

```xml theme={null}
<component>Available Version Check</component>
<failure>A required update to Submission Validator is available. The latest version can be downloaded from https://aka.ms/currentsubvalzip. Download and install the update, then rebuild the package. Contact your 
Developer Account Manager for assistance.</failure> 
```

<a id="ID4AGDK" />

## 核准的 GDK 版本

當您建立適用於 PC 的 GDK 套件 (msixvc) 時，Submission Validator 會檢查您用來封裝的 GDK 是否為核准的 GDK 版本。如果該版本不在核准或已淘汰清單上，驗證程式記錄會顯示失敗。

```xml theme={null}
<failure>ILI_PcGdkUnsupportedThe GDK used to compile your binaries is not supported. Use only supported GDK versions according to the Approved Libraries page located at https://aka.ms/GdkApprovedLibs</failure>
```

如果該版本在已淘汰清單上，驗證程式記錄會顯示參考訊息。此訊息表示該版本已過期，將不會再收到 Hotfix。

```xml theme={null}
<info>The GDK used to compile your binaries is expired and will no longer receive hotfixes.</info>
```

如果 Submission Validator 無法從套件中包含的檔案判斷 GDK 版本 (例如，因為檔案已加密)，則會顯示下列訊息。

```xml theme={null}
<info>A GDK version was not able to be extracted from your game executable. The version of the tools used for packaging will be used as the GDK version for this submission. If this is not correct, ensure any executables listed in your MicrosoftGame.config include XGameRuntime.h or you include appropriate middleware which consumes this header. See https://aka.ms/EmbeddedGdkVersion for more information.</info>
```

<a id="EmbeddedGdkVersion" />

### GDK 版本如何內嵌在遊戲可執行檔中

當您使用包含 `XGameRuntime.h` 的 GDK 編譯遊戲可執行檔時，編譯器會將 GDK 版本內嵌到名為 `.xbld` 的自訂 PE 區段中。Submission Validator 會讀取此區段，以判斷建置作品二進位檔所使用的 GDK 版本。

如果 `.xbld` 區段遺失或無法讀取，Submission Validator 會改為使用封裝工具的版本作為提交的 GDK 版本。此版本可能無法準確代表用來編譯二進位檔的 GDK 版本。

**常見原因：防竄改軟體**

處理您可執行檔的防竄改和資料加密工具，可能會加密或移除 `.xbld` 區段。此動作會使 Submission Validator 無法讀取該區段。若要解決此問題，請設定您的防竄改工具，將 `.xbld` 區段排除在處理之外。

#### Themida

將下列 **Advanced Option** (以逗號分隔) 新增至您的 Themida 設定檔，以將 `.xbld` 區段排除在保護之外：

```
OPTION_ADVANCED_DONT_PROCESS_SECTIONS=.xbld
```

#### GuardIT

若要在 GuardIT 中將 `.xbld` 區段排除在資料加密之外，請將 `<exclude>` 項目新增至您的加密防護設定：

```xml theme={null}
<guard_cmd name="EncryptionWrapper">
    <encryption_wrapper>
        <action>
            <fail />
        </action>
        <algorithm_decryption>
            <use>AES128</use>
        </algorithm_decryption>
        <algorithm_integrity>
            <use>fast</use>
        </algorithm_integrity>
        <protected_types>
            <custom>
                <data>true</data>
                <native_code>true</native_code>
                <unused_areas>true</unused_areas>
            </custom>
        </protected_types>
        <exclude>
            <range>
                <section matching="exact">.xbld</section>
            </range>
        </exclude>
        <debug>false</debug>
        <disable>false</disable>
    </encryption_wrapper>
</guard_cmd>
```

`<exclude>` 區段可防止 `.xbld` 被加密。

<a id="ID4EKB" />

## 核准的 Game OS

Submission Validator 會檢查 Game OS 和 Microsoft Game Development Kit (GDK) 中的任何選用元件是否來自 Microsoft Game Development Kit (GDK) 的同一個版本，以及它們是否為核准可用於已發行作品的版本。如果該版本不在核准或已淘汰清單上，驗證程式記錄會包含失敗，如下一節所示。

````xml theme={null}
<failure>The GameOS included in this package is not an approved version. Use only 
supported GameOS versions according to the Approved Libraries page on the Developer 
Network Portal</failure>  
```

如果在已淘汰清單上找到該版本，驗證程式記錄會包含參考訊息。此訊息表示該版本已過期，將不會再收到 Hotfix，如下一節所示。

```xml
<info>The GameOS included in this package is expired and will no longer receive hotfixes.</info>  
````

如果元件的版本彼此不符，或該版本不在核准或已淘汰清單上，驗證程式記錄會包含失敗，如下一節所示。

```xml theme={null}
<failure>The GameOS version does not match the version of other Microsoft components 
included in this package. Use only components from the same Microsoft Game Development Kit (GDK)/Xbox One Software Development Kit release. Refer to the 
Approved Libraries page on the Developer Network Portal</failure>  
```

<Note>如果執行 Submission Validator 的開發電腦無法存取線上資訊，Submission Validator 可能無法完成其驗證檢查。例如，該電腦沒有網際網路存取、遭防火牆封鎖，或沒有網路連線。</Note>

<a id="ID4EHD" />

## 內容 (可下載內容 (DLC)) 最後區塊中的啟動標記

為確保在所有情況下都能正常運作，內容套件必須以啟動標記屬性標示最後一個區塊。如果最後一個區塊不包含啟動標記，套件可能可以正確通過測試，但在某些情況下會對終端使用者造成問題。失敗訊息如下所示。

```xml theme={null}
<failure>Content Packages require final layout chunk to include attribute marker="Launch"</failure>  
```

<a id="ID4EWD" />

<a id="ID4EDE" />

## 額外的 Resources.pri 檔案

Submission Validator 會檢查配置的其他目錄中是否不存在額外的 *Resources.pri* 檔案。與 *MicrosoftGame.config* 一樣，只會使用根目錄中的檔案。不過，擁有多個複本可能會導致混淆，不清楚哪一個是正確的，以及開發人員對這些其他檔案的意圖為何。

此檢查與針對 MicrosoftGame.config 額外複本的類似檢查相對應。在此情況下，額外的複本會在記錄的 Foreign Files Check 區段中導致失敗，如下所示。

```xml theme={null}
<failure>D:\path\mytitle\mytitlesubdirectory\resources.pri</failure>  
```

<a id="ID4ERF" />

## 遺失 Resources.pri 檔案

應用程式不需要當地語系化。不過，如果應用程式的根目錄 (與 MicrosoftGame.config 相同的位置) 中不包含 *Resources.pri* 檔案，輸出記錄的 Foreign Files Check 區段中會出現下列警告。

```xml theme={null}
<warning>Non-localized app: 'resources.pri' is missing</warning>  
```

<a id="ID4EBBAC" />

## 每個套件一個應用程式

Submission Validator 現在會驗證每個套件只包含一個非 DevOnly 應用程式。

<a id="ID4E3BAC" />

## 套件大小上限

當您以光碟出貨時，Submission Validator 會檢查套件大小是否未超過 49,900,000,000 位元組。此檢查只會提供參考訊息，而不是錯誤。

當您不以光碟出貨時，Submission Validator 會檢查套件大小是否未超過 500 GB。當套件大小超過 450 GB 時，它也會提供警告訊息。訊息如下：

```xml theme={null}
(WARNING) ILI_XvcPackageSizeApproached: "The size of this package is approaching the maximum allowed size for uploading to Partner Center. The maximum size of a package for uploading to Partner Center is {0} GB."
```

```xml theme={null}
(FAILURE) ILI_XvcPackageSizeExceeded: "The size of this package exceeds the maximum allowed size for uploading to Partner Center. The maximum size of a package for uploading to Partner Center is {0} GB."
```

<a id="ID4EDCAC" />

## 外來檔案

審查 XBOX 360 計畫的提交時遇到的一個問題是，提交中包含了各種不應屬於零售作品的檔案，而這通常是意外造成的。

Foreign File Check 會使用配置 .xml 檔案，檢查帶入作品套件的所有檔案中，是否有套件中不允許的特定檔案名稱和副檔名。此檢查僅以檔案名稱為依據，而非檔案內容。不允許的檔案包括與原始程式碼和偵錯檔案相關的副檔名、Thumb.db、根目錄以外的多餘註冊檔案，以及不能出現在作品套件中的完整 XBOX 作業系統檔案清單。此檢查會驗證 XBOX 需求 XR-003：提交的作品品質。

下表顯示提交的作品套件中不允許的檔案類型和副檔名。

| 檔案類型 | 副檔名 |
| - | - |
| 原始程式碼相關檔案 | .c .cpp, .cs, .lib, .h, .obj |
| 偵錯/符號資訊檔案 | .pdb, .sym |
| 舊版二進位檔 | .xbe |

作品可以合法使用幾乎任何可想像的副檔名，這可能會與副檔名檢查產生潛在衝突。如果此情況影響您的作品，請通知您的合作夥伴開發經理 (PDM)。

如果您認為自己有特殊情況，需要在作品套件中包含某個檔案，而該檔案在 Submission Validator 記錄中收到失敗訊息，請洽詢您的 PDM。

下列範例顯示在 Foreign File Check 中回報失敗的記錄輸出。

```xml theme={null}
<component>Foreign File Check</component>
<failures>
  <failure>c:\MyTitle\loose\bar.cpp</failure>
  <failure>c:\MyTitle\loose\MySubDir\example.h</failure>
  <failure>c:\MyTitle\loose\MySubDir\PDBs\BlockedFiles\foo.pdb</failure>
</failures>
<filecount>3</filecount>  
```

<a id="ID4EEEAC" />

## 二進位檔掃描

XBOX 主機二進位檔 (.exe 和 .dll) 檔案必須針對 AMD64 建置，且只能是原生程式碼。目前，平台不支援受控程式碼二進位檔。Binary Scan Check 會檢查您包含在作品套件中的每個 .exe 和 .dll 檔案，並確保其符合這些需求。使用此檢查來驗證 XR-003：提交的作品品質。

在 Binary Scan 區段中，會檢查每個 .exe 和 .dll 檔案是否有基於安全性理由而在零售主機上遭封鎖的相依性。一般而言，此封鎖的形式是連結至平台檔案的偵錯版本、PIXEvt.dll 或 XBOX Studio。

下列範例顯示在 Binary Scan Check 中回報失敗的記錄輸出。前兩個失敗是由於 .exe 檔案連結至兩個零售主機不允許的檔案所致。第三個失敗是受控 .exe 檔案。最後一個失敗是非 AMD64 原生程式碼 .dll 檔案。

```xml theme={null}
<component>Binary Scan</component>
      <dumpbinlocation>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\dumpbin.exe</dumpbinlocation>
      <failures>
   <failure>Non-retail dependency in file c:\MyTitle\loose\ExeWithDebugDependencies.exe: MSVCR110D.dll</failure>
  <failure>Non-retail dependency in file c:\MyTitle\loose\ExeWithDebugDependencies.exe: PIXEvt.dll</failure>
  </failures>
  <failure>Managed: Not AMD64: c:\MyTitle\loose\MySubDir\ABC.exe</failure>
  <failure>Not AMD64: c:\MyTitle\loose\MySubDir\XYZ.dll</failure>
</failures>  
```

開發人員應確保在要包含於提交套件中之二進位檔的發行組建中，排除這類以偵錯為主的相依性。

<a id="ID4ESFAC" />

## Microsoft 元件版本

Game OS 涵蓋 XBOX 大部分的平台介面範圍。不過，作品會轉散發一組 Microsoft 提供的二進位檔。XBOX 開發人員論壇網站上的 [Approved Libraries](https://aka.ms/GdkApprovedLibs) 頁面會列出這些檔案及其核准的版本。

Submission Validator 會檢查這些檔案的版本，以確保任何選用的 DLL 檔案都是相符的版本。它也會擷取獨佔分割區作品封裝到 XVC 中之 Game OS 的版本識別碼。提交前，請對照已發佈的核准程式庫資訊檢查這些版本。

如果您的作品包含選用的 Kinect 和 XBOX services DLL 檔案，Submission Validator 也會擷取其版本資訊。

下列範例顯示出現在 Submission Validator 記錄檔中的版本資訊。

```xml theme={null}
<component>MS Component Versions</component>
<component name="GameOS">60BBA05C-22F0-4452-84B6-DD278594716E</component>
<component name="Microsoft.Xbox.Services.dll">10.0.18362.7198</component>  
```

<a id="ID4MDF" />

## 遺失相依檔案

當您動態連結至相依程式庫時，如果這些程式庫遺失，Submission Validator 會包含下列失敗：

```xml theme={null}
<failure>{0}: Binary file has a dependency on a file that is not included in the layout: {1}. This file must be included in the layout for your package.</failure>
```

<a id="IDDKDF" />

## ARM64 二進位檔

您可以在適用於 PC 的遊戲套件中，將 ARM64 二進位檔與現有的 x64 編譯可執行檔一起包含。Submission Validator 會檢查以確保 MicrosoftGame.config 正確參考適當的可執行檔。

```xml theme={null}
<failure>Executable with the Architecture attribute set to ARM64 is not compiled for the ARM64 platform. Please ensure the attributes are set correctly for this executable in your MicrosoftGame.config file.</failure>
```

```xml theme={null}
<failure>Executable is compiled for the ARM64 platform but does not have the Architecture attribute set to ARM64. Please ensure the attributes are set correctly for this executable in your MicrosoftGame.config file.</failure>
```

<a id="ID4E5OAC" />

## 另請參閱

[Submission Validator (SubmissionValidator.dll)](/zh-TW/build/core-features/common/packaging/subval/submissionvalidator)

[Submission Validator 訊息](/zh-TW/build/core-features/common/packaging/subval/submissionvalidator-messages)

[建立套件 (makepkg.exe)](/zh-TW/build/core-features/common/packaging/deployment/makepkg)

[作品封裝、內容更新和串流安裝測試](/zh-TW/build/core-features/common/packaging/title-packaging-streaming-install-testing)

XBOX 需求 (XR) [(XBOX Developer Downloads->Partner, Publishing, and Release Management Information->XGD Partner Documentation)](https://aka.ms/xgddl)


## Related topics

- [XR-003 提交的遊戲品質](/zh-TW/publishing/certification/xr/xr-003.md)
- [XBOX 遊戲的 XBOX 需求](/zh-TW/publishing/certification/xbox-requirements.md)
- [Submission Validator の品質チェック](/ja-jp/build/core-features/common/packaging/subval/submissionvalidator-tests.md)
- [Submission Validator (SubVal) 品質チェック リファレンス](/ja-jp/build/core-features/common/packaging/subval/index.md)
- [Submission Validator (SubmissionValidator.dll)](/ja-jp/build/core-features/common/packaging/subval/submissionvalidator.md)
