OrElse
OrElse

Reputation: 10009

User scope vs Application scope in app.config

What is the difference between the User scope and Application scope in app.config?

Upvotes: 10

Views: 8898

Answers (3)

dicksonlim0226
dicksonlim0226

Reputation: 1

Application-scoped vs. User-scoped Settings:

Application-scoped settings:

  • Apply to all users of the application.
  • Typically stored in the App.config or Web.config file.
  • Typically used for settings that affect the overall application behavior, such as server URLs, connection strings, feature flags, application paths and default values.
  • Cannot be modified by users at runtime.
  • Must be explicitly saved using My.Settings.Save() if changes are made programmatically.

User-scoped settings:

  • Apply to individual users of the application.
  • Stored in a user.config file, located in each user's application data folder.
  • Typically used for settings that personalize the user experience, such as preferences (e.g. Preferred language), layout choices, window size, last-used document paths and toolbar configuration.
  • Can be modified by users at runtime.
  • Changes are automatically saved to the user.config file.

Upvotes: 0

JaredPar
JaredPar

Reputation: 755587

User Scoped Settings will only affect the current user and are relatively safe to set. They are stored in a user specific location so there is no real issue with writing to them.

Application Scoped Settings on the other hand are read-only and cannot be changed

Upvotes: 8

Mitch Wheat
Mitch Wheat

Reputation: 300837

User-scope settings are used to store values specific to each individual user, whereas application-scope settings are used for all users.

Take a look at this article.

Upvotes: 8

Related Questions