Here is my scenario I need to load up an different app.config file That contains my settings for log4net. In my project I have created a class that inherits from the IConfigurationReader. For the Methode getSection I load up my config file and return the section.
I can see that it is loading up the config file and the section but it is not casting it to the Type I have defined in the config file.
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net4">
<arg key="configType" value="FILE-WATCH"/>
<arg key="configFile" value="C:\Users\dwarner\Documents\Visual Studio 2012\Projects\ConsoleApplication2\ConsoleApplication2\Config\log4net.config" />
</factoryAdapter>
</logging>
I can see that it load up the raw XML but I have no idea why it will not create my Factory Adapter. I have tried the fully qualified name in the config with no luck.
Thanks for the Help
As long as you set the ConfigurationReader on your LogManager and null the Adapter so it reloads the config settings it should work. You'll also need to make sure that your IConfigurationReader loads the section as it's own DocumentElement: