Is there a way to tell .NET where to look for a user settings file?

Basically, several instances of our application will be launched, but they must have separate user settings. We currently use “user preferences” for this, and it is great for a single instance (for each Windows user), but we would like to be able to run multiple instances with the settings path passed through the command line. Is there a way to do this with the built-in .NET settings, or will we have to minimize our own?

+3
source share
5 answers

I recommend developing a class that will handle application settings and accept a file name. I had to do this for DLLs that need application settings, and also helps if you want to save your settings in a non-local location (for example, in one place on the network).

This will give you much more flexibility - it is definitely worth the investment!

+1
source

The LocalFileSettingsProvider class, the one that manages the user settings file, is completely impossible to configure. Whoever writes that he must have been paralyzed by security concerns. Perhaps not unreasonably.

System.Configuration, . , - RegistrySettingsProvider. , , , . peeks Reflector .

+3

.Net API . app.config - API. API, API, .

0

. , , . .

Personalization user interface and profile API for information extraction. It is very easy to update information in the database, and then process files that are in user systems.

0
source

There is an interesting CodeProject article that has a custom parameter provider. You only need a little customization of your code, and then it allows you to save and load the settings in the folder that you provide.

0
source

Source: https://habr.com/ru/post/1737249/


All Articles