I'm getting this exception on 50% of WinXP SP3 machines. I know about 260 characters path length limit, but what can be done?
I'm already naming files to only 2 characters, without any subdirectories, but path to IsolatedStorage is already above 260 characters on half of WinXP machines.
There ´s seems to be no real solution for this problem. The default path for the Isolated Storage under Windows XP is <SYSTEMDRIVE>\Documents and Settings\\Local Settings\Application Data\Microsoft\Silverlight\is on an english system, what is already really long. On MSDN is a good article about using Isolated Storage and Best Practises.
When you use isolated storage, following these guidelines will help you avoid problems and make the most of the protection isolated storage provides.
To get around a PathToLongException you could check first the path of the IsolatedStorage and use an internal mapping to store your files in the IsolatedStorage. If the path to IsolatedStorage is too long by itself you should consider hosting the silverlight application on it´s own site and use IsolatedStorageFile.GetUserStoreForSite.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With