Adrian Grigore
unread,Jul 4, 2009, 7:16:18 AM7/4/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ninject
Hi,
Ninject looks great, so I'd like to use it in my project.
Unfortunately I am still struggling to do the most trivial binding.
The [Inject] attribute compiles just fine, but the compiler cannot
find the "Bind" command:
using System;
using Ninject.Core;
using Ninject.Core.Binding;
namespace NinjectTest
{
public interface IFoo
{
void DoSomething();
}
public class Foo : IFoo
{
public void DoSomething()
{
throw new NotImplementedException();
}
}
public class Bar
{
[Inject] private IFoo theFoo;
public Bar()
{
Bind<IFoo>().To<Foo>(); //Compiler Error: "The name 'Bind'
does not exist in the current context"
}
}
}
What could be going wrong here?
Thanks,
Adrian