Chris
Chris

Reputation: 6072

Migrate Application.Settings from Local to Roaming

My application has so far stored settings in %APPDATA%/Local - all this is handled by the default Application.Settings.

We're trying to upgrade this to store in %APPDATA%/Roaming, to support a virtualisation setup. The settings save fine, but saved preferences from previous versions are lost.

We previously upgraded between versions using Settings.Default.Upgrade(), however, this doesn't seem to map between Local and Roaming settings. Is there another API solution, or would we need to manually map between the two versions?

Upvotes: 0

Views: 113

Answers (1)

David BS
David BS

Reputation: 1892

You need to manually map this.

I believe the best approach should be create a Settings-like file into Roaming (you may or not utilize XML format) and manually store/read its contents.

Even if you locate it at ROAMING but try to utilize it in the My.Settings context, the Settings will be created at the default location.

Upvotes: 1

Related Questions