question

SmilingMoon avatar image
0 Votes"
SmilingMoon asked SmilingMoon commented

Windows application packaging project for UWP, how to handle Assets?

UWP uses lots of files from Assets folder.
When I add the UWP project as main start point to the package project, it doesn't move Assets and local files.

How should I handle this? What is the best practice?

  • Do I have to copy all files with the same folder structure to Package project? Or, is there a way I can configure for VS to handle those (even sync when changed)?

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered SmilingMoon commented

Hello,

Welcome to Microsoft Q&A!

Do I have to copy all files with the same folder structure to Package project? Or, is there a way I can configure for VS to handle those (even sync when changed)?

It seems that you are trying to package your UWP app using the Windows Application Package Project, right? If it is, then you don't need to move the Assets from the UWP app. Actually, the Windows Application Package Project is just a container and a bridge, it does not affect how the UWP app uses its own resources like the Assets folder, it connects the UWP app and other desktop apps that you package together. The UWP app will still use the resources in its own Assets folder if you want to display images and do other actions. When you need to change resources in the Assets folder, just do it in the UWP app as you did before.

Update:

So your issue is about the App Icons and tile images. That's excepted. What you need to do is just generate the logo icons again like what you did in UWP apps. Find the image you used in your UWP app, and generate other icons in the Windows Application Package Project. Then you should be able to see the splash screen and the app icon.


Thank you.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What about Package.appxmanifest?
UWP app runs fine by itself and Splash image displays properly when it runs by itself.
But, when it runs from package, splash doesn't show.

Do I have to copy the same Package.appxmanifest file to the Package project?
=> If so, the path to Assets in <uap:VisualElements>?
=> Do I have to copy only those Assets related to the values configured in <usp:VisualElements>?

0 Votes 0 ·

That's interesting. Could you please tell me how do you set the splash screen? So I could make a simple test about this.

0 Votes 0 ·

Here is the sample application I created: https://1drv.ms/u/s!AqB-HjXxUE9ngeJJFzJvZpk52jBf8w?e=fsGVgH

TestUWP: I used VS Visual Assets UI and "Generate" splash and all other visual assets with "Asset Generator".
When I run this, MS logo splash shows on launch.

TestPackageProject: When I run this to launch TestUWP, logo doesn't show. I think it has its own VisualElements in its own Package.appxmanifest.

So, there is Package.appxmanifest confliction between TestUWP and TestPackageProject. I think TestPackageProject running use its own Package.appxmanifest file. Then, I have to keep copying the changed values manually if there is no auto sync.

0 Votes 0 ·
Show more comments