C# User-Scope Settings Not Erased on Un-Install

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nielsena54
    New Member
    • Oct 2007
    • 4

    C# User-Scope Settings Not Erased on Un-Install

    Hi all,

    I have an application setting (user-scope) that tracks if the application is opened for the first time. There are also some other settings such as user names that are stored.

    I have a deployment project that installs / uninstalls the application. After installing the project on a machine and setting these user settings (such as user name), they stick as they should. However, if I uninstall and then install the application, the settings remain saved. This means that the application incorrectly assumes that it is not the first time it is being opened. Also, the user settings previously established are hanging on. I want them to be cleared out to their defaults.

    This is strange because when I look at the config file itself, the values are as I would expect. Where is the application pulling these values from? How do I stop it from doing that?

    Thanks....
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I think it creates another copy of the config file under the user's like "applicatio n settings" section of their userprofile (documents and settings\userna me\)

    I found mine:
    Code:
    C:\Documents and Settings\(username)\Local Settings\Application Data\(company name from Assembly file in project)\(program name + GUID)\(Version)\user.config

    Comment

    • nielsena54
      New Member
      • Oct 2007
      • 4

      #3
      Thanks! That was exactly it.

      Now, a follow-up question:

      Is there a way to have the un-install process remove this config file?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I've never done an install/uninstall project.
        I guess for uninstall, you could have it check to see if the file exists and wipe it out
        (perhaps with option to retain it?)

        Comment

        Working...