You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an interface is bound to a class (named) and that class needs the same interface in it's constructor with a different name ninject throws complaining about a cyclic dependency.
This is different from the previous version of ninject which correcly resolved this,
example:
interface IScreen
{
}
class View1 : IScreen
{
private readonly IScreen _childView;
public View1([Named("ChildView")] IScreen childView)
{
_childView = childView;
}
}
class ChildView : IScreen
{
public ChildView()
{
}
}
class Program
{
static void Main(string[] args)
{
var kernel = new StandardKernel();
kernel.Bind<IScreen>().To<View1>().Named("MainView");
kernel.Bind<IScreen>().To<ChildView>().Named("ChildView");
var instance = kernel.Get<IScreen>("MainView"); // <-- This throws with a cyclic dependency exception
}
}
The text was updated successfully, but these errors were encountered:
When we updated the ninject package in our solution, we ran exactly into this issue. We've seen, that its fixed but not yet provided on nuget.
Could you please create a new package (3.3.4) containing this fix.
When an interface is bound to a class (named) and that class needs the same interface in it's constructor with a different name ninject throws complaining about a cyclic dependency.
This is different from the previous version of ninject which correcly resolved this,
example:
The text was updated successfully, but these errors were encountered: