I am writing a class library which has settings in its app.config and which will ultimately be called by a small number of other .NET applications. In order to get settings from it I'm using ConfigurationManager.GetSection such as this:
MyConfiguration process = (MyConfiguration)ConfigurationManager.GetSection("MyGroup/processes");
I've discovered though that the calling application has to have the same app.config inside it's own project in order for this to work, otherwise the class library will throw a NullReferenceException
. I'm just wondering if this is normal behavior or if there's any way to ensure that only the class library needs to have app.config available?
Thanks :)