views:

20

answers:

1

Hello guys. For save my configuration_data I use isolated stoeage domain scope like:

 IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetUserStoreForDomain();

But sometimes at saving data I get:

   System.Reflection.TargetInvocationException: Exception has been thrown by the  
   target of an invocation. ---> System.IO.PathTooLongException: The specified path,
   file name, or both are too long. The fully qualified file name must be less than 
   260 characters, and the directory name must be less than 248 characters.
   at System.IO.PathHelper.Append(Char value)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)

Ok my fileName is too long. But I can't control it. Also I can't use application scope, cause I don't use ClickOnce.

So what should I do? Thanks

+1  A: 

This is a known issue with IsolatedStorage.

You could use the user profile (AppData) to store your information as apposed to the IsolatedStorage API.

Michael Baker
Thanks. Can you be so kind to give some links?
Andrew Kalashnikov
For this issue we built a wrapper around the SpecialFolder enum (see http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx). Created our storage directory, then built the directory structure as required ("Cache", "Updates" etc).
Michael Baker