Search code examples
c#.netapplication-settings

Updating .settings outside of application c#


I am building a class library that needs a .config, class libraries do not use an app.config/web.config. The config files can be updated after the application has deployed and we do this for updating our connection strings etc. My question is that I have a .Settings that I am storing the settings for my class library in, can I update this file manually after the application has been built or can this only be done by the application? E.g. change directories of a logger output.


Solution

  • You can easy create .config file for your class libraries, it's just XML file. U create in your class libraries class that will load that file and read setting from XML file. U can edit it from everywhere. Only thing you need to worry about is when your "APP" read that file and you change it , then u need your "APP" to read it again! That part is tricky , i suggest you use File System Watcher class for that.