UWP Build Issue with Resource size (.PRI file issue)

0

In my UWP project, heavily using string resources more than 20 languages and each have 50k+ key values. Also it has lot of screens and controls.

Until certain limit, not getting any build issue. But once I added 3k more keys getting unspecified build error with MSBuild. Strangely if I reduce some keys build again works.

Build Command

MSBuild.exe MyProject.sln /p:AppxBundlePlatforms="x64" /p:AppxPackageDir="$(Build.ArtifactStagingDirectory)\MyProject\AppxPackages\\" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly /p:UseDotNetNativeToolchain=false /p:Use64BitCompiler=true

Error

error PRI175 : 0x80004004 - Processing Resources failed with error : Operation aborted [D:\VSTS Agent\vsts-agent-win-x86-2.155.1\_work\24\s\MyProject.csproj]
  GENERATEPROJECTPRIFILE : error PRI222: 0xdef0000f - Unspecified error occurred. [D:\VSTS Agent\vsts-agent-win-x86-2.155.1\_work\24\s\MyProject.csproj]
    1654 Warning(s)
    2 Error(s)

After sometime identified the issue with PRI file. As per MS Documentation PRI file size lime is 64kb. But it worked well for me till 18mb (Yes! my resources.pri file size is 18.6mb and still build and working).

As said earlier, if I add some more keys the resources.pri file becomes 21mb and always getting failed (Release build with disabled .Net Native Toolchain)

Luckily it build successfully with .Net Native Toolchain enabled.

Any suggestion to resolve this issue?

Thanks in advance!

c#
uwp
azure-devops
msbuild
asked on Stack Overflow Apr 20, 2020 by Ramanan

1 Answer

0

As per MS Documentation PRI file size lime is 64kb.

Thanks very much for reporting this issue, I have gotten the confirmation that the 64KB limitation in the documentation is incorrect, it is going to be updated.

As said earlier, if I add some more keys the resources.pri file becomes 21mb and always getting failed (Release build with disabled .Net Native Toolchain)

Luckily it build successfully with .Net Native Toolchain enabled.

For the size about 21mb, it seems like that you may be hitting an upper limitation on the amount of items allowed within the PRI file.

If we add more more strings in future, not sure the .Net native build too

Since we do review this periodically and allow for extra capacity for the PRI file, so if you still want to increase the PRI file into a more large file than 21mb, could you please try to use latest insider preview builds(20H1) to see if it helps alleviate what you are seeing?

Thanks.

answered on Stack Overflow May 9, 2020 by Amy Peng - MSFT

User contributions licensed under CC BY-SA 3.0