WPF。 IsolatedStoreage FileName长度

时间:2010-09-10 17:58:59

标签: c# wpf file isolatedstorage

为了保存我的configuration_data,我使用了隔离的stoeage域范围,如:

 IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetUserStoreForDomain();

但有时我会保存数据:

   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)

好的,我的fileName太长了。但我无法控制它。另外我不能使用应用程序范围,因为我不使用ClickOnce。

那我该怎么办? 感谢

1 个答案:

答案 0 :(得分:1)

这是IsolatedStorage的一个已知问题。

您可以使用用户个人资料(AppData)将您的信息存储为与IsolatedStorage API相关联。