0

I made a windows forms application using vb.net and I'm using My.Settings to save some of the application settings (such as product keys and activation status)

Everything was working just fine until I found out that some computers for some reason keeps deleting My.Settings after the application has been closed for some time. I mean, I connect to the computer (using AnyDesk or another remote connection software) and notice the application is closed; open it and everything is gone; I set it all up again; Close and reopen de application; everything looks fine but in a week the same thing.

I found it kinda strange because on some computers it works OK but in some others, it just doesn't. Of course, I made sure to check the "Save My.Settings at exit" and also save it manually with code. It kinda looks like this:

Public Sub SaveSettings()
      'Some code from all the app settings here.
      My.Settings.Save()
 End Sub

Is it a Windows configuration or something? Should I build my own settings file instead of using My.Settings? Help :(

Adan Sandoval
  • 436
  • 1
  • 6
  • 18
  • When you say "I connect to the computer and notice the application is closed" could it be that the application was forced to close and so did not have a chance to save the settings? Or do you manually save the settings as soon as they are changed (not just on application exit)? – Andrew Morton May 19 '16 at 17:11
  • Since Settings is just a file on their machine (though in an obscure location), the issue shows how simple it would be to just copy one to another machine. If you have recompiled for a new version, you may need to `Upgrade` settings – Ňɏssa Pøngjǣrdenlarp May 19 '16 at 17:21
  • 2
    "Connect to the computer" implies to me that you are using some kind of remote desktop. Are you always using the same account to connect? Settings files are stored in the user profile, so different account would have different setting files, or a blank one on first run. – Bradley Uffner May 19 '16 at 17:25
  • 2
    @mike100111 He says he does in the 3rd paragraph. – Bradley Uffner May 19 '16 at 17:27

0 Answers0