MakePri resources generate issue

StewartBW 1,905 Reputation points
2025-10-20T13:40:05.6266667+00:00

Hello experts,

I'm having hard times configuring my priconfig.xml for manual generating of my resources.pri, here's my working priconfig.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources targetOsVersion="10.0.0" majorVersion="1">
	<index root="\" startIndexAt="\">
		<default>
			<qualifier name="Language" value="en-US"/>
		</default>
		<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
		<indexer-config type="resw" convertDotsToSlashes="true" initialPath=""/>
		<indexer-config type="resjson" initialPath=""/>
		<indexer-config type="PRI"/>
	</index>
</resources>

The problem is that it will include VFS folder and all other files on the root (AppxManifest.xml etc...) so updated:

<index root="" startIndexAt="">
to
<index root="" startIndexAt="Assets">

Now it's only including Assets folder, which is fine, but now, Instead of:

<ResourceMapSubtree name="Files">
<ResourceMapSubtree name="Assets">
<NamedResource name=...

I will have:

<ResourceMapSubtree name="Files">
<NamedResource name=...

Please advise how to fix the priconfig.xml to start index at "Assets" folder, but also include the "Assets" folder itself too?

Thanks in advance :)

Windows development | Windows App SDK
{count} votes

2 answers

Sort by: Most helpful
  1. Tony Dinh (WICLOUD CORPORATION) 4,400 Reputation points Microsoft External Staff
    2025-10-21T03:10:24.42+00:00

    Hello @StewartBW !

    The behavior you’re seeing comes from how the <index> element interprets root and startIndexAt:

    • root defines the physical folder where indexing begins.
    • startIndexAt defines the logical subtree name where resources are placed in the PRI.

    For more detail, refer to: https://learn.microsoft.com/en-us/windows/uwp/app-resources/makepri-exe-configuration

    When you set startIndexAt="Assets", makepri treats Assets as the starting point and doesn’t include the folder name itself in the logical tree — it flattens it. That’s why you’re getting:

    <ResourceMapSubtree name="Files">
      <NamedResource name=...
    

    Instead of nesting under <ResourceMapSubtree name="Assets">.


    Preserve the Assets folder in the PRI tree

    If you want to both:

    • Exclude root-level files like AppxManifest.xml, and
    • Keep Assets as a subtree in the PRI.

    To do this, set root to the project root, but startIndexAt to empty, and then scope the indexer to the Assets folder explicitly, for example:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <resources targetOsVersion="10.0.0" majorVersion="1">
      <index root="\" startIndexAt="">
        <default>
          <qualifier name="Language" value="en-US"/>
        </default>
     
        <!-- Only index inside Assets -->
        <indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="." initialPath="Assets"/>
        <indexer-config type="resw" convertDotsToSlashes="true" initialPath="Assets"/>
        <indexer-config type="resjson" initialPath="Assets"/>
        <indexer-config type="PRI" initialPath="Assets"/>
      </index>
    </resources>
    

    Alternative

    If you want to keep the flexibility of indexing multiple folders later, you can also define multiple <index> blocks, one per folder, e.g.:

    <index root="Assets" startIndexAt="Assets">
      ...
    </index>
    

    But the initialPath trick is usually cleaner.


    I hope this helps! Let me know if you have any question

    1 person found this answer helpful.

  2. Darran Rowe 2,531 Reputation points
    2025-10-20T19:11:13.3333333+00:00

    Makepri has a /projectroot command line option, this is the root for the pri resources. This doesn't have to point at the same directory as anything else. So one option is to put your resources in a subdirectory that /projectroot will point to.

    Another option is to use a file which names the files that you want to be referenced by the .pri file.

    <?xml version="1.0" encoding="utf-8"?>
    <resources targetOsVersion="10.0.0" majorVersion="1">
      <index root="\" startIndexAt="resources\resourcefiles.resfiles">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="RESFILES" qualifierDelimiter="." />
      </index>
    <!-- Other indexer configurations-->
    </resources>
    

    The .resfiles that is being referenced is just a plain text file that contains a relative path to the resource.

    Images\BadgeLogo.scale-100.png
    Images\BadgeLogo.scale-125.png
    Images\BadgeLogo.scale-150.png
    Images\BadgeLogo.scale-200.png
    Images\BadgeLogo.scale-400.png
    Images\LargeTile.scale-100.png
    Images\LargeTile.scale-125.png
    Images\LargeTile.scale-150.png
    Images\LargeTile.scale-200.png
    Images\LargeTile.scale-400.png
    Images\LockScreenLogo.scale-100.png
    Images\LockScreenLogo.scale-125.png
    Images\LockScreenLogo.scale-150.png
    Images\LockScreenLogo.scale-200.png
    Images\LockScreenLogo.scale-400.png
    Images\SmallTile.scale-100.png
    Images\SmallTile.scale-125.png
    Images\SmallTile.scale-150.png
    Images\SmallTile.scale-200.png
    Images\SmallTile.scale-400.png
    Images\SplashScreen.scale-100.png
    Images\SplashScreen.scale-125.png
    Images\SplashScreen.scale-150.png
    Images\SplashScreen.scale-200.png
    Images\SplashScreen.scale-400.png
    Images\Square150x150Logo.scale-100.png
    Images\Square150x150Logo.scale-125.png
    Images\Square150x150Logo.scale-150.png
    Images\Square150x150Logo.scale-200.png
    Images\Square150x150Logo.scale-400.png
    Images\Square44x44Logo.scale-100.png
    Images\Square44x44Logo.scale-125.png
    Images\Square44x44Logo.scale-150.png
    Images\Square44x44Logo.scale-200.png
    Images\Square44x44Logo.scale-400.png
    Images\Square44x44Logo.targetsize-16.png
    Images\Square44x44Logo.targetsize-24.png
    Images\Square44x44Logo.targetsize-32.png
    Images\Square44x44Logo.targetsize-48.png
    Images\Square44x44Logo.targetsize-256.png
    Images\StoreLogo.scale-100.png
    Images\StoreLogo.scale-125.png
    Images\StoreLogo.scale-150.png
    Images\StoreLogo.scale-200.png
    Images\StoreLogo.scale-400.png
    Images\Wide310x150Logo.scale-100.png
    Images\Wide310x150Logo.scale-125.png
    Images\Wide310x150Logo.scale-150.png
    Images\Wide310x150Logo.scale-200.png
    Images\Wide310x150Logo.scale-400.png
    Images\BadgeLogo.theme-dark_scale-100.png
    Images\BadgeLogo.theme-dark_scale-125.png
    Images\BadgeLogo.theme-dark_scale-150.png
    Images\BadgeLogo.theme-dark_scale-200.png
    Images\BadgeLogo.theme-dark_scale-400.png
    Images\LargeTile.theme-dark_scale-100.png
    Images\LargeTile.theme-dark_scale-125.png
    Images\LargeTile.theme-dark_scale-150.png
    Images\LargeTile.theme-dark_scale-200.png
    Images\LargeTile.theme-dark_scale-400.png
    Images\LockScreenLogo.theme-dark_scale-100.png
    Images\LockScreenLogo.theme-dark_scale-125.png
    Images\LockScreenLogo.theme-dark_scale-150.png
    Images\LockScreenLogo.theme-dark_scale-200.png
    Images\LockScreenLogo.theme-dark_scale-400.png
    Images\SmallTile.theme-dark_scale-100.png
    Images\SmallTile.theme-dark_scale-125.png
    Images\SmallTile.theme-dark_scale-150.png
    Images\SmallTile.theme-dark_scale-200.png
    Images\SmallTile.theme-dark_scale-400.png
    Images\SplashScreen.theme-dark_scale-100.png
    Images\SplashScreen.theme-dark_scale-125.png
    Images\SplashScreen.theme-dark_scale-150.png
    Images\SplashScreen.theme-dark_scale-200.png
    Images\SplashScreen.theme-dark_scale-400.png
    Images\Square150x150Logo.theme-dark_scale-100.png
    Images\Square150x150Logo.theme-dark_scale-125.png
    Images\Square150x150Logo.theme-dark_scale-150.png
    Images\Square150x150Logo.theme-dark_scale-200.png
    Images\Square150x150Logo.theme-dark_scale-400.png
    Images\Square44x44Logo.theme-dark_scale-100.png
    Images\Square44x44Logo.theme-dark_scale-125.png
    Images\Square44x44Logo.theme-dark_scale-150.png
    Images\Square44x44Logo.theme-dark_scale-200.png
    Images\Square44x44Logo.theme-dark_scale-400.png
    Images\Square44x44Logo.theme-dark_targetsize-16.png
    Images\Square44x44Logo.theme-dark_targetsize-24.png
    Images\Square44x44Logo.theme-dark_targetsize-32.png
    Images\Square44x44Logo.theme-dark_targetsize-48.png
    Images\Square44x44Logo.theme-dark_targetsize-256.png
    Images\StoreLogo.theme-dark_scale-100.png
    Images\StoreLogo.theme-dark_scale-125.png
    Images\StoreLogo.theme-dark_scale-150.png
    Images\StoreLogo.theme-dark_scale-200.png
    Images\StoreLogo.theme-dark_scale-400.png
    Images\Wide310x150Logo.theme-dark_scale-100.png
    Images\Wide310x150Logo.theme-dark_scale-125.png
    Images\Wide310x150Logo.theme-dark_scale-150.png
    Images\Wide310x150Logo.theme-dark_scale-200.png
    Images\Wide310x150Logo.theme-dark_scale-400.png
    Images\Square44x44Logo.altform-lightunplated_targetsize-16.png
    Images\Square44x44Logo.altform-lightunplated_targetsize-24.png
    Images\Square44x44Logo.altform-lightunplated_targetsize-32.png
    Images\Square44x44Logo.altform-lightunplated_targetsize-48.png
    Images\Square44x44Logo.altform-lightunplated_targetsize-256.png
    Images\Square44x44Logo.altform-unplated_targetsize-16.png
    Images\Square44x44Logo.altform-unplated_targetsize-24.png
    Images\Square44x44Logo.altform-unplated_targetsize-32.png
    Images\Square44x44Logo.altform-unplated_targetsize-48.png
    Images\Square44x44Logo.altform-unplated_targetsize-256.png
    

    The base is the project root.

    If you want to keep using folder, the best you can do is put things in a subdirectory and change root to point at that subdirectory.

    <?xml version="1.0" encoding="utf-8"?>
    <resources targetOsVersion="10.0.0" majorVersion="1">
      <!-- Starts looking for the resources in the FolderResource subdirectory-->
      <index root=".\FolderResource" startIndexAt=".\">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="." />
        <indexer-config type="resw" convertDotsToSlashes="true" />
      </index>
    </resources>
    

    This subdirectory is isolated from the project root, but it is placed in the resources tree at the expected location. A .pri generated from this dumped using priconfig dump shows the following:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <PriInfo>
    	<ResourceMap name="Test" version="1.0" primary="true">
    		<Qualifiers>
    			<AlternateForm>LIGHTUNPLATED,UNPLATED</AlternateForm>
    			<Scale>100,125,150,200,400</Scale>
    			<TargetSize>256,16,24,32,48</TargetSize>
    			<Theme>DARK</Theme>
    		</Qualifiers>
    		<ResourceMapSubtree name="Files">
    			<ResourceMapSubtree name="Images">
    				<NamedResource name="BadgeLogo.png" uri="ms-resource://Test/Files/Images/BadgeLogo.png">
    					<Candidate qualifiers="Theme-DARK, Scale-400" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.theme-dark_scale-400.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Theme-DARK, Scale-200" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.theme-dark_scale-200.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Theme-DARK, Scale-150" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.theme-dark_scale-150.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Theme-DARK, Scale-125" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.theme-dark_scale-125.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Theme-DARK, Scale-100" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.theme-dark_scale-100.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Scale-400" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.scale-400.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Scale-200" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.scale-200.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Scale-150" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.scale-150.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Scale-125" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.scale-125.png</Value>
    					</Candidate>
    					<Candidate qualifiers="Scale-100" isDefault="true" type="Path">
    						<Value>.\Images\BadgeLogo.scale-100.png</Value>
    					</Candidate>
    				</NamedResource>
    ...
    

    So the resources are indexed properly in the tree.

    If makepri is run with the following command line:

    makepri new -pr G:\xamlcmdline -cf resources\priconfig-folder.xml -of out.pri -in Test -v -o

    With the following directory structure:

    enter image description here

    Then it has no issues doing what you want.

    Two major notes here. First, even though I am using the Images directory, the name is irrelevant. Assets is just as good a name, and the directory names are user definable. Secondly, the pri config file can contain multiple indexer configuration sections. An example of one of the main ones that I use for projects is:

    <?xml version="1.0" encoding="utf-8"?>
    <resources targetOsVersion="10.0.0" majorVersion="1">
      <index root="\" startIndexAt="resources\filtered.layout.resfiles">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="RESFILES" qualifierDelimiter="." />
      </index>
      <index root="\" startIndexAt="resources\resources.resfiles">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="RESW" convertDotsToSlashes="true" />
        <indexer-config type="RESJSON" />
        <indexer-config type="RESFILES" qualifierDelimiter="." />
      </index>
      <index root="\" startIndexAt="resources\pri.resfiles">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="PRI" />
        <indexer-config type="RESFILES" qualifierDelimiter="." />
      </index>
      <index root="resources\embed" startIndexAt="embed.resfiles">
        <default>
          <qualifier name="Language" value="en-GB" />
          <qualifier name="Contrast" value="standard" />
          <qualifier name="Scale" value="100" />
          <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="" />
          <qualifier name="Platform" value="UAP" />
        </default>
        <indexer-config type="RESFILES" qualifierDelimiter="." />
        <indexer-config type="EMBEDFILES" />
      </index>
    </resources>
    

    The first section is to handle image and other file resources. The second is to handle .resw files. The third is to add .pri files from sub components or the main application if the packaging step is separate from the build step. The fourth is for the resources that you wish to embed into the .pri file.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.