I have a concrete class of logger that Microsoft.Unity will Resolve ILogger to.
the logger class has two constructors
1. public logger()
2. public logger(List<BaseLogger> Loggers)
I have the unity section in my web.config file looking like this.
<unity>
<containers>
<container>
<types>
<type type="MyCompany.Logger.ILogger, MyCompany.Logger"
mapTo="MyCompany.Logger.logger, MyCompany.Logger">
</type>
</types>
</container>
</containers>
</unity>
If I remove the constructor listed as 2. this logger class will succeed being Resolved by Unity. When I add it back I get this error...
Resolution of the dependency failed, type = "MyCompany.Logger.ILogger", name = "(none)". Exception occurred while: while resolving. Exception is: InvalidOperationException - The type List`1 has multiple constructors of length 1. Unable to disambiguate.
Can anyone explain how I can change my web.config entry to handle having the 2. listed overloaded constructor in logger to work while trying to Unity.Resolve?