Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 685423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:55:15+00:00 2026-05-14T01:55:15+00:00

I have a large config file (user) that i needed to go to the

  • 0

I have a large config file (user) that i needed to go to the right location and have some default values.

Since i have a installer class, i added some parameter setting to the config file in it, but created the config files in the installers folder.

What is the best way to ensure these default parameters will be written only once, and in the right location?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:55:16+00:00Added an answer on May 14, 2026 at 1:55 am

    A standard way of using defaults in the app.config. For example, here’s a default value per version I use to ensure the code copies user settings between upgrades:

    <userSettings>
        <Software.Namespace.Properties.UserSettings>
          <setting name="RequiresUpgrade" serializeAs="String">
            <value>True</value>
          </setting>
        </Software.Namespace.Properties.UserSettings>
      </userSettings>
      <-- .... -->
      <userSettings>
        <Software.Namespace.Properties.UserSettings>
          <setting name="RequiresUpgrade" serializeAs="String">
            <value>True</value>
          </setting>
        </Software.Namespace.Properties.UserSettings>
      </userSettings>
    </configuration>
    

    You will need to add a .settings file to your project, or go to your project properties -> Settings and configure them from there.

    The location of the user’s own settings file is usually placed within their AppSettings folder in their profile. I’m not sure if this can be changed, but I seem to remember reading out it.

    EDIT

    There’s some more information about it here: Application Settings Architecture

    It also shows the following example if you want to keep it simple:

    [UserScopedSetting()]
    [DefaultSettingValue("white")]
    public Color BackgroundColor
    {
        get
        {
            return ((Color)this["BackgroundColor"]);
        }
        set
        {
            this["BackgroundColor"] = (Color)value;
        }
    }
    

    And this looks like it’s very important to note when using this (quote):

    For a Windows Forms-based application
    copied onto the local computer,
    app.exe.config will reside in the same
    directory as the base directory of the
    application’s main executable file,
    and user.config will reside in the
    location specified by the
    Application.LocalUserAppDataPath
    property
    . For an application installed
    by means of ClickOnce, both of these
    files will reside in the ClickOnce
    Data Directory underneath
    %InstallRoot%\Documents and
    Settings\username\Local Settings.

    The storage location of these files is
    slightly different if a user has
    enabled roaming profiles
    , which
    enables a user to define different
    Windows and application settings when
    he or she is using other computers
    within a domain. In that case, both
    ClickOnce applications and
    non-ClickOnce applications will have
    their app.exe.config and user.config
    files stored under
    %InstallRoot%\Documents and
    Settings\username\Application Data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very large mp3's stored at a remote location and I presently
I have large video files (~100GB) that are local on my machine. I have
In my application I have large area (≈5000x5000pts) and I must allow user to
I have 3 HTML pages for my website. They all have large parts that
I'm developing a website in PHP and I have large JS files that I
I have a User entity which has a HasCompletedSecurity property which indicates whether that
I am currently updating a few settings in a rather large *.exe.config file via
We have a large multi tenanted website which requires thousands of lines of web.config
We are developing an application that uploads large files over Internet. File size before
I have quite some trouble creating a WCF service that supports downloads of very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.