Adding all images to the Package.AppXManifest resu

2019-05-07 01:25发布

问题:

I have specified win8_logo_small.png for the "Small logo" in the Package.appxmanifest setting of my Windows 8 Store project. When I create a store package, I get this warning:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(1052,9):
warning APPX1621: A mixture of images matching logical name 'win8_logo_small.png' exists
in this project with and without the "scale" or "targetsize" qualifier specified.
For predictable runtime behavior, explicitly specify the scale or target size
in each image asset's file name.

Although this is a mere warning, I'd like to know what Microsoft wants me to do about it because the names for the image scale variants are auto-generated:

win8_logo_small.scale-80.png
win8_logo_small.scale-100.png
...
win8_logo_small.targetsize-16.png
win8_logo_small.targetsize-32.png

If I rename the xxx.targetsize files to something like xxx.scale-###.png and add it to the project, Visual Studio automatically copies the file to a xxx.targetsize-##.png!

Is this something that can be solved? Does it need solving or is it just a bug in the Windows RT package compiler?

回答1:

The scale and targetsize images should be mutually exclusive. From How to name resources using qualifiers

The targetsize qualifier can specify resources at a particular size (in pixels). It is primarily used to specify file type association icons or protocol icons shown in the desktop Windows Explorer. This qualifier is typically used for square images or icons and specifies only a single image dimension. The system or app requesting the resource (ResourceContext.QualifierValues) must explicitly specify a targetsize. There is no default. If you use the targetsize qualifier on a resource, you should not use the scale qualifier.

Visual Studio could be a bit more clear about this, agreed, since the app manifest UI implies you could/should supply all of them.