I’m creating my first Windows Forms Application, and one requirement is that there is some sort of config file, which the client can edit in notepad. For example, the config file may have an XML structure of:
<languages>
<language name="English" />
</languages>
The application accesses the file when generating a combobox of languages on a form. If the client wishes, he could go in and add another <language> node.
I’ve tried to use the app.config file, with a custom configuration section. When I publish the application and then install it, the [appname].exe.config.deploy file in the [appname]/Application Files/[appname_version]/ folder is editable, but the application doesn’t seem to be aware of the edits. In other words, if I add another <language> node, the application doesn’t display it on the form.
I’m not sure if I’m actually doing any of this correctly. Are users supposed to be able to edit the config.deploy file? If not, what is the correct usage scenario? I’m thinking back to the old days of games having .ini files, which you could edit in Notepad!
Add your xml file to the project > select file & go to property window > Build Action as content > copy to output directory to Copy if newer or always. Change your code to read languages list from xml file located at exe folder location