Ninjectはすばらしく見えるので、プロジェクトで使用したいと思います。残念ながら、私はまだ最も些細な拘束をするのに苦労しています。 [インジェクト]属性は正常にコンパイルされますが、コンパイラは「バインド」コマンドを見つけることができません:Ninjectのコンパイルエラー
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"
}
}
}
何が問題になる可能性がありますか?
BTW StandardModuleが2.0のNinjectModuleに置き換えられました –