我遇到了每次第一次運行應用程序時都會收到IsolatedStorageException('IsolatedFileStorageStream不允許操作「)的問題。隨後運行該應用程序的時間,它工作得很好。我已經嘗試了所有可以找到的用於寫入的打開文件的方法,包括第一次緩存訪問時出現IsolatedStorageException
using (var iso = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream file = new IsolatedStorageFileStream(fileName, FileMode.Create, FileAccess.Write, iso))
{
}
using(var iso = IsolatedStorageFile.GetUserStoreForApplication())
using(IsolatedStorageFileStream file = iso.OpenFile(fileName, FileMode.OpenOrCreate))
{
}
以及其他各種重載方法。我所做的沒有任何工作,並且我已經在堆棧溢出的每一個帖子以及我可以找到的每篇博文中都遵循了這些步驟。當我查看輸出時,每次拋出以下例外:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll
有沒有人有任何其他想法,爲什麼它會爆炸?我正在使用WP7 7.1 RTM工具。
如果這有幫助,請投票!或檢查答案! – Keeano