简体   繁体   English

将整个文件夹添加到Visual Studio 2012中的打包Winrt

[英]Add entire folder to packaging Winrt in Visual Studio 2012

I have a folder Assets/source . 我有一个文件夹Assets/source It has a lot of files (.png,.xml ...) and also divided with sub folders inside. 它有很多文件(.png,.xml ...),并且内部还有子文件夹。 Is it possible to have them all copy to the output directory without manually setting them one by one? 是否可以将它们全部复制到输出目录而无需手动逐个设置它们? or to copying this folder to /LocalState at runtime? 还是要在运行时将此文件夹复制到/LocalState 在此处输入图片说明

I have tried adding it to paths, I cant seem to find it in the installation folder after install. 我尝试将其添加到路径,安装后似乎无法在安装文件夹中找到它。 Thanks for any advice. 感谢您的任何建议。

  1. Copy and paste them to Assets/... 复制并将它们粘贴到Assets/...
    (By default, Build Action is Content , Copy to output is Do not copy. Leave it at default) (默认情况下,“构建操作”为“内容”,“复制到输出为不复制。保留默认值)”

  2. During run time : 在运行期间:
    StorageFolder sourceFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("Assests/...");

In Visual Studio, select all the files that you want copied to the output directory, and in the "Properties" window, change the setting in "Copy to Output Directory" to "Copy Always". 在Visual Studio中,选择要复制到输出目录的所有文件,然后在“属性”窗口中,将“复制到输出目录”中的设置更改为“始终复制”。 I don't think you could do that to the entire folder though. 我认为您无法对整个文件夹执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM