Hello there is something very strange happening here, i have these lines of code working perfectly in another testing solution but when i have them in my main solution i have a problem:
When i run it normally, it doesnt do anything, when i run in Debug and go step by step then it works.
private async void InitializeContents()
{
var path = @"Assets\Data\";
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
try
{
var file = await folder.GetFileAsync(path + "test.txt");
var lines = await FileIO.ReadLinesAsync(file);
var pref = "";
foreach (string line in lines)
{
if (line.ElementAt(0).Equals('-'))
{
switch (line.ElementAt(1))
{
case 'c': { pref = @"City\";break; }
case 'v': { pref = @"Village\"; break; }
}
continue;
}
file = await folder.GetFileAsync(path + pref + line);
var sub_lines = await FileIO.ReadLinesAsync(file);
}
}
catch (FileNotFoundException)
{
}