by Viper
5. March 2009 19:28
While working on a Silverlight project, I had to write and read some data into Isolated storage. While creating a file in a sun folder i kept getting following error.
{System.IO.IsolatedStorage.IsolatedStorageException:
Operation not permitted on IsolatedStorageFileStream.
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor
(String path, FileMode mode, FileAccess access, FileShare share,
Int32 bufferSize, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor
(String path, FileMode mode, FileAccess access, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile
(String path, FileMode mode, FileAccess access)
at SilverSockets.Page.CreateIsolatedStorageForUser()}
I am developing on Windows7 development machine. So for a moment I thought it may be that there is restriction on Windows7 and I have to make some changes in some silverlight settings or configuration. After spending a few minutes I realized that my creation of sub folder failed in previous step and i did not check it. And I went to on to creating the file in sub folder. Well, the message did not even come close to telling me that folder does not exist. After I fixed creation of sub folder everything worked smoothly. So if you do get this error, check if the folder or file path exists before you go down some wild chase on this error message.