Windows Phone アプリの .NET 4.5 で json ファイルからデータを読み込もうとしています。ボタンを押すと、次のような例外が表示されます。
System.IO.FileNotFoundException (Exception from HRESULT: 0x80070002)
私のコード:
public static async Task ReadFile()
{
StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
if (local != null)
{
var file = await local.OpenStreamForReadAsync("bazaDanych.json");
using (StreamReader streamReader = new StreamReader(file))
{
json = streamReader.ReadToEnd();
}
}
}
私のソリューション エクスプローラーのビューは次のとおりです。