【发布时间】:2018-07-28 16:18:15
【问题描述】:
我创建了一个 C# 可执行文件,它创建了一个 test 文件夹并将 test.txt 文件从它的执行文件夹复制到 AppData 文件夹。这是我的代码:
static void Main()
{
string fullPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\test";
string destination = $"{fullPath}\\test.txt";
Directory.CreateDirectory(fullPath);
string location = System.Reflection.Assembly.GetExecutingAssembly().Location;
int index = location.LastIndexOf("\\");
string source = $"{location.Substring(0, index)}\\test.txt";
File.Copy(source, destination);
}
然后我使用本文Package an app manually 中的模板制作appxmanifest.xml 文件。我用makeappx 和signtool 制作了一个UWP 包。但该可执行文件不会创建test 文件夹,也不会将test.txt 文件复制到AppData 文件夹。我不想在 Visual Studio 中使用 UWP 项目。我应该在 appxmanifest.xml 文件中添加一些额外的行吗?
【问题讨论】:
标签: uwp desktop-bridge