I ran into the same problem using StructureMap to dynamically find assemblies. It seems that the ConfigurationManager is only looking for the specified assembly for ConfigurationSection in the Bin-Folder and GAC. It does not seem to work even if the assembly is loaded into the current AppDomain.
But the fact that the ConfigurationSection assembly is already loaded can be used for a simple workaround:
AppDomain.CurrentDomain.AssemblyResolve += (o, args) => { var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); return loadedAssemblies.FirstOrDefault(asm => asm.FullName == args.Name); };
AssemblyResolve-Event is fired whenever the CLR cannot find a specific assembly. Just register the callback before the first call to GetSection ().
It works for me.
Joachim rosskopf
source share