Scope configuration file saving directory with User C #

3

For configuration files in C # , I have always used App.config only to write connection strings and some read-only variables, but currently I needed to modify some data at run time, hence the scope issue: User and Application .

Application Scope

Read-only and can be changed only in design time or by modification in the [AssemblyName].exe.config file between application sessions.

User Scope

Read and / or write at runtime and its values can be changed and saved in code.

The question is, when running Properties.Settings.Default.Save(); to a configuration file with the scope User is it possible to change the location where the file with the persisted data will be saved? p>

In Debug the application is saving in

C:\Users\A_tuxpilgrim\AppData\Local\Nome_do_Projeto\Nome_do_Projeto.vshost._....0.0\user.config

obs: This article > and this question in the SOen helped a lot, just the question of the same directory .

    
asked by anonymous 20.09.2018 / 19:36

1 answer

1

Not possible. This article talks a little about it .

If you need the configuration file in a separate location, you must write your own mechanism to manage it.

    
22.09.2018 / 16:54