Windows Store 응용 프로그램 (일명 Metro)에 대한 간단한 유틸리티 콜렉션이 있는데, ApplicationData.Current.LocalFolder.GetFileAsync
을 연속적으로 호출 할 때 멈추는 것으로 나타났습니다. 즉, 디버깅하고 단계별로 실행하려고하자마자 문제가 사라짐).GetFileAsync가 중단 될 수있는 원인은 무엇입니까?
public static async Task<LocalCache<T>> LoadCache()
{
try
{
// Get the input stream for the cache
StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(GetFileNameForType());
using (IInputStream inStream = await file.OpenSequentialReadAsync())
{
// Deserialize the cache
DataContractSerializer serializer = new DataContractSerializer(typeof(LocalCache<T>));
return (LocalCache<T>)serializer.ReadObject(inStream.AsStreamForRead());
}
}
catch (FileNotFoundException)
{
return new LocalCache<T>();
}
}
은에서 파일을 열 수있는 모드를 지정할 수있는 과부하로가 표시되지 않습니다, 그것은 좀 난처한 상황에 빠진 나를 떠나있는 반환 나타나지 않습니다. 이 교착 상태를 방지하려면 어떻게해야합니까?
매력처럼 작동합니다 :) thanks man –