I'm trying to create an app on the hololens that creates and writes to a text file to log inputs from the user. Currently, I'm stuck on trying to make the file and access it from the file explorer or the one drive. This is the method I have:
public void createFile()
{
#if WINDOWS_UWP
Task task = new Task(
async () =>
{
testText.text="hi";
StorageFolder storageFolder = ApplicationData.Current.LocalFolder;
StorageFile textFileForWrite = await storageFolder.CreateFileAsync("Myfile.txt");
});
task.Start();
task.Wait();
#endif
}
It's basically what I found here: https://forums.hololens.com/discussion/1862/how-to-deploy-and-read-data-file-with-app, but when I try to run that method, the app on the hololens freezes for a bit then closes. Is there something wrong with the code? Any idea what is going on? Thanks in advance