简体   繁体   中英

IsolatedStorageException: [IsolatedStorage_Operation_ISFS] exception in Windows phone app

I am trying to read a file containing audio data which I captured from mic.Now when I query the application store using following query I can see the list of files saved in my IsolatedStorage.

The query:

var f = userStore.GetFileNames();
foreach (var df in f) {
   System.Diagnostics.Debug.WriteLine(df);
}

result of query:

Audio.sdf
Audio1.wav
Audio2.wav

But when I try to read file "Audio1.wav" using this query:

FileStream = new IsolatedStorageFileStream(FileName, FileMode.Open, userStore);

I get the following error:

An exception of type 'System.IO.IOException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll
An exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
System.IO.IsolatedStorage.IsolatedStorageException: [IsolatedStorage_Operation_ISFS]
Arguments: 
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50829.0&File=mscorlib.dll&Key=IsolatedStorage_Operation_ISFS
   at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
   at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(String path, FileMode mode)
   at AudioRecorder.MainPage.start_player()

Any help?

Try this, it may be help you. give FileAccess permission. When we want to read to a file we use FileAccess.Read! You can find a list of all FileAccess possibilities from http://msdn.microsoft.com/en-us/library/4z36sx0f%28v=VS.90%29.aspx

using (IsolatedStorageFileStream fileStream = userStore.OpenFile(FilePath, FileMode.Open, FileAccess.Read))
{
   //your code                    
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM