I call
mActionLogManager = container.Resolve<IActionLogManager>();
and when debugging I see it runs through only the non default ctor
public ActionLogManager(IUnityContainer container)
{
Init(container);
}
Doesn’t unity always calls the parameter-less ctor?
I have tried to write and delete the parameter-less ctor.
-
It didn’t go through it when it existed,
-
and didn’t throw an exception when was missing.
update:
and if so, how it knows what parameters to fill in the ctor?
This is the default behavior of Unity. It tries to resolve an instance by using the ctor with the most parameters. If you want to instruct Unity to use the default ctor you need to register the type as follows: