Skip to content
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions uwp/app-resources/build-resources-into-app-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ There is one final step that you need to do. **But only if you deleted the `Lang
```xml
<default>
<qualifier name="Language" value="en;es;fr" />
...
<qualifier name="Contrast" value="standard" />
<qualifier name="Scale" value="200" />
<qualifier name="HomeRegion" value="001" />
<qualifier name="TargetSize" value="256" />
<qualifier name="LayoutDirection" value="LTR" />
<qualifier name="DXFeatureLevel" value="DX9" />
<qualifier name="Configuration" value="" />
<qualifier name="AlternateForm" value="" />
</default>
```

**Note** Make sure to include all qualifier values in your `priconfig.default.xml` file to preserve the built-in defaults for qualifiers you're not customizing. For the complete list of default values, see [Specify the default resources that your app uses](specify-default-resources-installed.md).

### How does this work?

Behind the scenes, Visual Studio launches a tool named `MakePri.exe` to generate a file known as a Package Resource Index, which describes all of your app's resources, including indicating which resource qualifier names to auto-split on. For details about this tool, see [Compile resources manually with MakePri.exe](compile-resources-manually-with-makepri.md). Visual Studio passes a configuration file to `MakePri.exe`. The contents of your `priconfig.packaging.xml` file are used as the `<packaging>` element of that configuration file, which is the part that determines auto-splitting. So, adding and editing `priconfig.packaging.xml` ultimately influences the contents of the Package Resource Index file that Visual Studio generates for your app, as well as the contents of the packages in your app bundle.
Expand Down Expand Up @@ -85,7 +94,17 @@ Here's how that looks after you've deleted the first qualifier name.

Save and close, and rebuild your project.

There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported languages as your app's default language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md). This is what your project file would contain if you included resources for English, Spanish, and French in your app package.
There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported languages as your app's default language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md).

**Important** When you specify `<AppxDefaultResourceQualifiers>`, you must include all qualifier values that you want to preserve from the built-in defaults. If you only specify some qualifiers (like Language), you will lose the built-in defaults for all other qualifiers (such as Scale, Contrast, etc.). For example, if you don't include `Scale=200`, your app may be missing scaled images.

Here's what your project file should contain if you included resources for English, Spanish, and French in your app package, while preserving the built-in defaults for other qualifiers:

```xml
<AppxDefaultResourceQualifiers>Language=en;es;fr|Contrast=standard|Scale=200|HomeRegion=001|TargetSize=256|LayoutDirection=LTR|DXFeatureLevel=DX9|Configuration=|AlternateForm=</AppxDefaultResourceQualifiers>
```

If you only need to specify the language and want to keep all other defaults unchanged, you can use the shorter version, but be aware it will override all defaults:

```xml
<AppxDefaultResourceQualifiers>Language=en;es;fr</AppxDefaultResourceQualifiers>
Expand Down