WPF: isolated storage file path too long
I'm deploying my WPF app with ClickOnce. When developing locally in Visual Studio, I store files in the isolated storage by calling IsolatedStorageFile.GetUserStoreForDomain()
. This works just fine and the generated path is
C:\Users\Frederik\AppData\Local\IsolatedStorage\phqduaro.crw\hux3pljr.cnx\StrongName.kkulk3wafjkvclxpwvxmpvslqqwckuh0\Publisher.ui0lr4tpq53mz2v2c0uqx21xze0w22gq\Files\FilerefData\-581750116 (189 chars)
But when I deploy my app with ClickOnce, the generated path becomes too long, resulting in a DirectoryNotFoundException
when creating the isolated storage directory. The generated path with ClickOnce is:
C:\Users\Frederik\AppData\Local\Apps\2.0\Data\OQ0LNXJT.R5V\8539ABHC.ODN\exqu..tion_e07264ceaf开发者_JAVA技巧d7486e_0001.0000_b8f01b38216164a0\Data\StrongName.wy0cojdd3mpvq45404l3gxdklugoanvi\Publisher.ui0lr4tpq53mz2v2c0uqx21xze0w22gq\Files\FilerefData\-581750116 (247 chars)
When I browse the folders all but the last directory of the path exists. Then when trying to create a folder at this location windows tells me I can't create a directory because the resulting path name will be too long.
How can I shorten the path generated by the IsolatedStorage?
well i found out it's a limitation of the windows filesystem (around 250 characters limit) and you can't choose or configure the path of the isolated store.
i 'fixed' the problem by changing the isolated storage scope from domain to application... not exactly the best solution but for now it'll do
精彩评论