I have a WPF project which has its own app.config file. I have also created a separate dll which my WPF project references. My dll has its own app.config too.
The issue I have is in my dll I have a section of code (below) which doesn't work in the WPF application. From reading around this is because the start-up project's app.config file is the default file so when I use the ConfiguationManager below it does not find any of the app settings so the strings are null. As it is looking in the WPF's config file rather than my dll config. What is the best way to get around this issue as I don't want to have to make a copy of these settings in another config.
public Messenger()
{
_queueManagerName = ConfigurationManager.AppSettings["QueueManagerName"];
_queueNameSendMessage = ConfigurationManager.AppSettings["QueueNameSendMessage"];
_queueNameRecieveMessage = ConfigurationManager.AppSettings["QueueNameRecieveMessage"];
_queueChannel = ConfigurationManager.AppSettings["QueueChannel"];
_queueConnectionName = ConfigurationManager.AppSettings["QueueConnectionName"];
}
What is the best way to solve this problem? All I want is for my dll to read its own config file rather than the WPF config file.