I decided to have a go at building Windows Metro style apps with the Windows Developer Preview again, after multiple frustrating experiences.
So I fire up Visual Studio
Because Metro applications use a subset of the .Net Framework API. In this version System.Console and System.IO.File
do not exist.
From MSDN, "Replace System.IO.File.ReadAllText
method with a method that uses the asynchronous I/O members; for example:"
public static async Task ReadAllText(StorageFile file)
{
IInputStream inputStream = await file.OpenForReadAsync();
using (Stream stream = inputStream.AsStream())
using (StreamReader reader = new StreamReader(stream))
{
return await Task.Run(() => reader.ReadToEnd());
}
}