Search code examples
ninjectninject-2

Ninject Contextual Binding: Where do I get Ninject.Conditions.dll


I've read about ninjects contextual binding here : http://ninject.codeplex.com/wikipage?title=Contextual%20Binding

and am trying to get it working in my project. The docs state that I need to add a reference to Ninject.Conditions.Dll which I do not have. Does anybody know where to get this?

I've tried over at github : https://github.com/ninject/ninject
I used the download link to get the 2.0.1.0 sources and managed to build them but no dll.

I found a similar question here : Where can I find ninject.web.mvc.dll?

and an answer with a link to a build server. I followed the link and I get a login request for team city. I don't have an account.


Solution

  • Your link is about a very old Ninject version. This is now in the main ninject assembly But the Syntax has changed.

    Bind<IFoo>().To<Foo>().When(request => DoSomeFilteringHere)
    

    Or use one of the other When overrides.