将资产复制到 UWP 应用程序包中 [英] Copying assets into UWP application package

查看:19
本文介绍了将资产复制到 UWP 应用程序包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含大量子文件夹的大型文件夹结构,我将这些子文件夹用于 UWP 应用程序中的应用程序数据.测试时,我可以将它放在磁盘上,这很好,但是当我制作商店包时,我需要能够复制该数据.我发现包含资产的唯一方法是手动添加单个文件进入 Visual Studio 并将它们设置为内容".有没有办法将整个文件夹复制为内容"并保留其文件夹结构?

I have a large folder structure with a ton of subfolders that I am using for application data in my UWP app. When testing, I can just have it sitting on disk and it's fine, but when I make a store package, I need to be able to copy that data in. The only way I've found to include assets is to manually add individual files into Visual Studio and set them to be "Content". Is there a way to copy in an entire folder as "Content" and preserve its folder structure?

推荐答案

您不必手动添加所有文件.将整个文件夹添加到 UWP 应用文件夹中.完成此操作后,您应该能够使用解决方案资源管理器中的 Show All Files 选项并添加整个文件夹.如果添加的文件的属性尚未设置为内容",则多选文件并将Properties窗口中的Build Action属性设置为Content

You don't have to manually add all the files. Add the entire folder inside the UWP app folder. Once you do that you should be able to use the Show All Files option in the solution explorer and add the entire folder. If the property of the added files is not already set to "Content", multi select the files and set the Build Action property in the Properties window to Content

[]

[]

这篇关于将资产复制到 UWP 应用程序包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆