The injection configuration for parameter <parameter> is specified through both attributes and child value elements
I'm getting this error when trying to resolve a type:
public sealed class CustomApplicationUpdateProvider : ApplicationUpdateProvider
{
IUpdateProviderController controller;
public CustomApplicationUpdateProvider(IUpdateProviderController controller)
{
this.controller = controller;
}
//more code here ....
}
using this configuration:
<Unity>
<typeAliases>
<typeAlias alias="IUpdateProviderController" type="example.IUpdateProviderController, example" />
<typeAlias alias="UpdateProviderController" type="example.UpdateProviderController, example" />
</typeAliases>
<container name="RealContext">
<register type="IUpdateProviderController" mapTo="UpdateProviderController"/>
<register type="CustomApplicationUpdateProvider">
<constructor>
<param name="controller" parameterType="IUpdateProviderController">
<dependency/>
</param>
</constructor>
</register >
</container>
</Unity>
I'm using Uni开发者_JAVA百科ty 2.0
any ideas?
Remove parameterType="IUpdateProviderController"
attribute.
Related:
Configuring Unity Container in Web.config
精彩评论