WPF: storage file path too long

I am deploying my WPF application using ClickOnce. When developing locally in Visual Studio, I store files in isolated storage by calling IsolatedStorageFile.GetUserStoreForDomain() . This works fine, and the generated path

C: \ Users \ Frederik \ AppData \ Local \ IsolatedStorage \ phqduaro.crw \ hux3pljr.cnx \ StrongName.kkulk3wafjkvclxpwvxmpvslqqwckuh0 \ Publisher.ui0lr4tpq53mz2v2c0uqx21xze0w22gq \ Files \ FilerefData \ -581750116 (189 characters)

But when I deploy my application using ClickOnce, the generated path gets too long, resulting in a DirectoryNotFoundException when creating an isolated storage directory. Generated path using ClickOnce:

C: \ Users \ Frederik \ AppData \ Local \ Apps \ 2.0 \ Data \ OQ0LNXJT.R5V \ 8539ABHC.ODN \ exqu..tion_e07264ceafd7486e_0001.0000_b8f01b38216164a0 \ Data \ StrongName.wy0cojdd3mpvq45404l3gxdklugoanvi \ Publisher.ui0lr4tpq53mz2v2c0uqx21xze0w22gq \ Files \ FilerefData \ - 581 750 116 (247 characters)

When I browse folders, all files except the last path directory exist. Then, when I try to create a folder in this place, the windows tell me that I can’t create the directory because the resulting path name will be too long.

How can I shorten the path generated by isolated storage?

+6
path wpf isolatedstorage
source share
1 answer

I found that this is a limitation of the Windows file system (limit of about 250 characters), and you cannot select or configure the path of isolated storage.

i "fixed" the problem by changing the selected storage area from the domain to the application ... not quite the best solution, but for now it will do

+1
source share

All Articles