Search code examples
c#environment

Environment Picker


is there any open source or use Environment Picker in dotnet that allows me to simply create a set of environments (whatever that may mean to my application) and then have a picker on startup.

it wouldn't be too hard to build a simple custom one but i would imagine that this is done over and over in every company so wanted to see if there was one put together.


Solution

  • Have a look at app.config files. They are XML files which contain user or application settings. You'll be able to specify different application (read-only) settings at compile-time. Additionally, you'll be able to specify user settings at runtime.

    I use app.config files to save and load things like window positions and other user preferences. I know many people store things like database connection strings, file paths, etc, in app.config.

    Here's a simple example.