问题描述
我有一个很大的文件夹结构,其中包含大量的子文件夹,这些文件夹用于我的UWP应用程序中的应用程序数据.测试时,我可以将其放在磁盘上就可以了,但是当我制作存储包时,我需要能够复制该数据.我发现包括资产的唯一方法是手动添加单个文件到Visual Studio中,并将它们设置为"Content".有没有一种方法可以将整个文件夹复制为内容"并保留其文件夹结构?
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 app文件夹中.完成后,您应该可以使用解决方案资源管理器中的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应用程序包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!