When upgrading an Assembly, what's the best way to migrate files in Isolated Storage?
Asked Answered
H

1

6

I have a .Net 2.0 C# application that occasionally gets updated and the Assembly Version and File Version are incremented. This is all working fine, but it also breaks storing xml settings files in Isolated Storage. (The xml files are generated by DevExpress XtraGridView.SaveLayoutToXml())

Is there a way to copy these files from the old folder in isolated storage to the new folder. i.e. From Appname\1.0.0.0 to Appname\1.0.1.0

Or is there a better place to store these xml files, that won't change when the File Version of the app changes?

I don't want to store these files in the application's .exe folder, as the app is not allowed to write to that folder in Vista without Admin privileges.

Hedgcock answered 23/2, 2009 at 1:3 Comment(0)
P
3

If you're using ClickOnce, you can use application-scoped isolated storage.

If you're not usingClickOnce, you can get the same effect by giving your application a strong name. A strong name guarantees the uniqueness of your assembly's identity by adding a public key token and a digital signature to the assembly.

Prudi answered 23/2, 2009 at 3:43 Comment(1)
I'm not using ClickOnce. I read in the second link you provided that it is not recommended to sign your main .exe assembly with a strong name. I ended up storing the xml as a string in the settings file, which does upgrade (with a couple of lines of code) with a version upgradeHedgcock

© 2022 - 2024 — McMap. All rights reserved.