0

为了保存我的 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)

好的,我的文件名太长了。但我无法控制它。我也不能使用应用程序范围,因为我不使用 ClickOnce。

所以我该怎么做?谢谢

4

1 回答 1

1

这是 IsolatedStorage 的一个已知问题。

您可以使用用户配置文件 (AppData) 将您的信息存储在与 IsolatedStorage API 相对的位置。

于 2010-09-14T00:17:33.637 回答