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

  • Home
  • SEARCH
  • 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 6105821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:00:45+00:00 2026-05-23T14:00:45+00:00

I have a simple console application which runs daily (called by windows task scheduler)

  • 0

I have a simple console application which runs daily (called by windows task scheduler) and depends on a value that is incremented each time the application runs. In order to persist this value I chose to use the Settings.Settings file.

So I have an integer value called RunNumber with Scope User which is incremented each time the application finishes running:

Properties.Settings.Default.RunNumber++;
Properties.Settings.Default.Save();

Part of the reason I chose this is that the value is also placed into the app.config file:

<setting name="RunNumber" serializeAs="String">
    <value>0</value>
</setting>

Which means that should the RunNumber have to be incremented unexpectedly it can just be changed in the app.config:

<setting name="RunNumber" serializeAs="String">
    <value>10</value>
</setting>

My expectation being that the next time my application goes to read the value of RunNumber it would take the value set in the app.config (in this case 10). This does not happen and instead the next time the application is run it will use the value it last modified in this case the run number would be 1 instead of the 10 I would expect.

My application accesses the value of RunNumber like this:

Properties.Settings.Default.RunNumber

How can I change the value of the RunNumber without having to modify the application? The idea being if it needs to be changed to a value unexpectedly I could just modify the value in the app.config instead of having to change some code and re-deploy the application.

  • 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-23T14:00:46+00:00Added an answer on May 23, 2026 at 2:00 pm

    The value that is placed in the app.config is the default used when a new user uses your application and his settings need to be created. After running the application once a user.config will be created to store the user scope settings.

    In order for you to change the value manually you need to do it in the corresponding user.config that you’ll find somewhere in the user profile directory, because if you change app.config only new users will see the change.

    In Windows 7 without roaming profile and with an Windows Forms Application named Example.Settings.CustomClass I’m getting the following folder for the user.config:

    C:\Users\[user]\AppData\Local\Microsoft\Example.Settings.CustomCl_Url_3qoqzcgn1lbyw2zx3oz1o3rsw2anyjsn\1.0.0.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple .NET application which runs as Windows Service. Say it has
I have a URI here in which a simple document.cookie query through the console
My intend is to create a simple easily debuggable console application which will be
We have a console application (currently .NET) that sends out mail in bulk to
I have the following projects: MVC Console application Class library Windows forms application COM
I have a question regarding some simple console I'm making. I know that it's
I am trying to make a simple phone directory program in windows console application.
I have an application which posts progress/status messages as it runs (it's a database
I have a simple web application (non sharepoint) in which i want to add
I have a rails application in which a user creates a record called a

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.