Every time I do a ConfigurationManager.GetSection("registeredPlugIns")
for this custom section I receive this error:
An error occurred creating the configuration section handler for registeredPlugIns:
Could not load type 'Engine.PlugInArch.PlugInConfigurationSection' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Why is it trying to load the type from System.Configuration
and not the assembly that I ask it to?
Here is my Section code:
namespace Engine.PlugInArch
{
public class PlugInConfigurationSection : ConfigurationSection
{
[ConfigurationProperty("plugIns", IsDefaultCollection = false),
ConfigurationCollection(typeof(PlugInCollection), AddItemName = "addPlugin")]
public PlugInCollection PlugIns
{
get { return this["plugIns"] as PlugInCollection; }
}
}
}
And here is my app.config
<configuration>
<configSections>
<section name="registeredPlugIns" type="Engine.PlugInArch.PlugInConfigurationSection, Engine"/>
</configSections>
...
<registeredPlugIns>
<plugIns>
<addPlugIn DllName="ProcessorPlugin.dll"/>
</plugIns>
</registeredPlugIns>
</configuration>