1

I save the user settings with Properties.Settings.

Properties.Settings.Default.key = "value";
Properties.Settings.Default.save();

and here is the saved file:

C:\Users\Me\AppData\Local\Me\MyCompany\0.0.1\user.config

How can I prevent that the version number is in the path, like that?

C:\Users\Me\AppData\Local\Me\MyCompany\user.config
David
  • 4,027
  • 10
  • 50
  • 102
  • 1
    You could write your own settings provider. Some information here: http://www.sellsbrothers.com/writing/dotnet2customsettingsprovider.htm – David Brabant Jun 11 '12 at 07:44
  • 1
    The number is the AssemblyInfo's AssemblyVersionAttribute setting. See http://stackoverflow.com/a/621295/495455 – Jeremy Thompson Jun 11 '12 at 08:15

1 Answers1

0

I have now found another way.

After starting the program I let run the following code:

if(Properties.Settings.Default.UpgradeRequired)
{
    Properties.Settings.Default.Upgrade();
    Properties.Settings.Default.UpgradeRequired= false;
    Properties.Settings.Default.Save();
}

UpgradeRequired is a user-specific property, the default value is true

David
  • 4,027
  • 10
  • 50
  • 102