Make your application settings store values in database

Application settings in .net applications is a mechanism that allows you to define, modify and easily access a collection of settings. Depending on the setting scope (user or application) they are stored in a .config file deeply under your %USER_PROFILE% folder or in your application’s .exe.config or web.config file. In this post I will show a way to change that behavior and ma…

By Mirek on (tags: settings, categories: None)

Mocking application settings

Last time I showed a simple way of using application settings in our wpf application. This time I would like to present you my way of testing Properties.Settings, or rather mocking it in our application tests. First of all we need to make our application code independent of the concrete implementation of auto generated Settings class. Let’s define an interface which will contai…

By Mirek on (tags: mocking, settings, testing, categories: code)

Where should I store settings of my application?

Where should I store user and application settings in my WPF application? Well, in Settings of course. Go to your WPF application properties and Settings tab. If there is nothing there but text in the middle, click on that text. This will create the Settings file in your project. Here you can add settings in the grid. The columns are: Name, Type, Scope and the Value. Name and t…

By Mirek on (tags: c#, settings, WPF, categories: architecture)