I have a config file for my application in C#. It works like a charm. On Initializing my GUI I read my Values and on changing them I change them in the file and save them.
read:
txtCPort.Text = XTD_List_T001.Properties.Settings.Default.cport;
write:
XTD_List_T001.Properties.Settings.Default.cport = txtCPort.Text;
XTD_List_T001.Properties.Settings.Default.Save();
But now I build my solution and I have an exe and an exe.config
file.
In my program it still works fine but it does not write/read anything from the exe.config
file in my folder. It's like there is some hidden file that stores the real values somewhere.
He still needs my config file though, because when I delete it he throws an error.
How can I Change the behaviour, so that he actually uses my exe.config
file?
Edit 1: I tried to explain in the comments why my question ist not an exact duplicate. I also added some Code. And I just now realized that i need to be able to deploy default Settings so i might not get around having a exe.config that works as the file in %appdata%
is local right?