I am modifying a project (1) (windows service). I was given a utility project(2) and I am using this is my project. I dont know why but this (2) has an initialization using ConfigurationManager.AppSettings[]
I use a custom config reader in my project as I wanted my own XML structure. The utility has no options to initialize using contructors or methods.
I did not want to change this utility much so I just changed this initialization using AppSettings to the config class in (1) (by creating a dependency to (1) from (2)). I know this is not the way to go about it. If I clean my solution it would be mess.
I could think of some ways. But not sure which will be the correct approach?
using utility;
ns pr1;
CustomConfigReader{ }
using pr1;
ns utility;
UtilityClass{
//Initialization of a lot variables
pr1.CustomConfigReader .......
}
Put the custom configuration code in its own DLL & have (1) & (2) both reference it. Then modify (2) so it uses the custom configuration code.