is My.Settings version specific?

  • Thread starter Thread starter Graham Charles
  • Start date Start date
G

Graham Charles

Since the .config file that contains the values in My.Settings is saved
to...

%USERPROFILE%\Local Settings\Application
Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>

....that implies that if I update the AssemblyVersionAttribute (make a
new build, say), my users' configuration files will no longer be valid.
Does that sound right? Seems like an odd default behavior. I suppose I
could manually copy the .config file during the upgrade installation,
but... well, it just seems silly.

Also, in a related question, the <companyname> in the above path seems
to have spaces replaced with underscores. Is that a documented
behavior, too? I can't find it in the SDK.

Thanks,

g.
 
Graham Charles said:
Since the .config file that contains the values in My.Settings is saved
to...

%USERPROFILE%\Local Settings\Application
Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>

...that implies that if I update the AssemblyVersionAttribute (make a
new build, say), my users' configuration files will no longer be valid.
Does that sound right? Seems like an odd default behavior. I suppose I
could manually copy the .config file during the upgrade installation,
but... well, it just seems silly.


You may want to check out the 'My.Settings.Upgrade' method.
 
Thanks for that. Is there a way to test if the application is being run
for the first time since an upgrade? IsFirstRun (in
....ApplicationDeployment) seems to pertain to ClickOnce apps only. For
now, I've created a new user-scoped setting "HasRun" with a default
value of False, and am setting it to true in my Main code:

If Not My.Settings.HasRun Then
My.Settings.Upgrade() ' / retrieve current settings
My.Settings.HasRun = True
End If

Does that look like a best practice?

Thanks again,

g.
 
Back
Top