Tutorial :What does an IsolatedStorage_Operation_ISFS error thrown from the IsolatedStorageFileStream constructor mean?



Question:

I have a Silverlight 4 application (plug... http://audioorchard.com ...end plug) that is occasionally throwing an exception in the IsolatedStorageFileStream constructor.

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.50524.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 AudioOrchard.Client.Utility.DiskManager.CreateNewFile(String fileName, Boolean wasDiskSpaceRequested) at... (enter's not SL runtime code here)

The url in the stack trace doesn't provide any help and neither did a google search. Where can I learn more about IsolatedStorage_Operation_ISFS and what would cause it?


Solution:1

It means you are hitting a file length limit in Silverlight isolated storage. The base storage location for isolated storage can be in a path with a very long name - it looks something like:

C:\\Users\\kevind\\AppData\\LocalLow\\Microsoft\\Silverlight\\is\\1325qaxz.ekn\\xyro13wm.cn0\\1\\s\\qc4wuhalx4ciu4u5hbqqfohd3y3y4m1guyj5xuv5ml5y5qjbjmaaaeea\\f

(and can be even longer on XP, where the base is C:\Documents and Settings)

Given that, it doesn't take much to hit the 260 character file path limit. The base path plus the internal path (inside isolated storage) plus the file name has to be less than 260 characters.

I've seen two different failure modes in this case:

  1. Trying to create a directory where the total path length (base path plus new path) is longer than 260 characters. This results in a PathToLongException raised by IsolatedStorageFile.CreateDirectory

  2. Trying to create a file using IsolatedStorageFileStream, where the total path length (base path plus internal path plus file name) is greater than 260 characters. This results in an IsolatedStorageException (IsolatedStorage_Operation_ISFS) raised by the IsolatedStorageFileStream constructor.

As far as I can tell, there's no real solution to this problem aside from catching the exceptions and carrying on. It's an unfortunately limitation of Silverlight.

There's a good article about the issue here:

http://msdn.microsoft.com/en-us/magazine/dd458794.aspx


Solution:2

Actually there is no constructor for IsolatedStorageFileStream with same parameters list:

System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)

Int32 bufferSize parameter is really excess here. Please check documentation for IsolatedStorageFileStream constructors.
I think there is some third party component which try to use non supported IsolatedStorageFileStream constructor.


Solution:3

I actually had this issue and to fix it I cleared my Silverlight cache. If you to to Program Files --> Microsoft Silverlight and click on the Application Storage tab, you can delete any or all of the sites listed there. I removed the site in question and was able to get right in next time.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »