Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define a custom path where the user.config file should be saved?

If I rename my compiled application for example from myapp.exe to app.exe then when I run the renamed executable a new user settings folder is generated in this path:

C:\Users\{User}\AppData\Local\{CompanyName}\{ExecutableName}_Url_{SystemGUID or something strange}

So I loose all the saved settings.

Then how I could solve this problem defining in a VBNET WinForms my own location to store the user.config file, or any other solution using the applicationsettings infrastructure ? (not saving the settings on the registry or other things)

PS: I've read this SO post which is a little bit different question but anyways I didn't understood the supposed solution Can I control the location of .NET user settings to avoid losing settings on application upgrade?

like image 464
ElektroStudios Avatar asked Nov 21 '13 11:11

ElektroStudios


People also ask

Where is the user configuration file located?

As per the XDG standard, all user-specific config files are stored inside the $XDG_CONFIG_HOME directory (usually /home/<username>/. config).

What is a user configuration file?

A configuration file, often shortened to config file, defines the parameters, options, settings and preferences applied to operating systems (OSes), infrastructure devices and applications in an IT context.


1 Answers

I suppose you could also open your config file from specific location using ConfigurationManager.OpenExeConfiguration method.

Hope I helped!

like image 62
Pantelis Natsiavas Avatar answered Oct 05 '22 07:10

Pantelis Natsiavas