我尝试将文件夹及其子文件夹(约 4000 个文件)作为内容添加到 C++ Windows 商店应用程序(在 VS2015 中)。
这是场景:
G:\Game -> is the build directory
D:\data -> holds the original content
我读过有一些方法可以在 .vxcproj 文件中声明外部内容,如下所示:
<ItemGroup>
<Content Include="D:\**">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<DeploymentContent>true</DeploymentContent>
</Content>
</ItemGroup>
这实际上将 D:\data 的内容复制到构建目录 (G:\Game) 中。这很棒,因为现在可以运行和调试程序。但是:一旦我将项目部署到AppX文件夹 (G:\Game\AppX),数据文件夹就不会在那里部署。
G:\Game\game.exe
G:\Game\data\...
G:\Game\AppX
G:\Game\AppX\game.exe
(G:\Game\AppX\data\... - missing)
有什么线索吗?