Fixed issue where the appdomain configuration file does not exist (there is no config).
Only applicable to .NET4.0+
Removed unnecessary section cast that caused the code to fail under Mono.