C# 用Ninject射击

C# 用Ninject射击,c#,ninject,ioc-container,hangfire,C#,Ninject,Ioc Container,Hangfire,我正试图使用Ninject的Hangfire 这是我的问题,我的项目布局如下: .Sln |- Core |- Web 现在在核心中是Hangfire方法: public class Scheduler { public void HangfireIoc() { BackgroundJob.Enqueue<MovieSaver>(x => x.SaveMovies()); } } Startup.cs(在Web中) 我

我正试图使用Ninject的Hangfire

这是我的问题,我的项目布局如下:

.Sln
    |- Core
    |- Web
现在在
核心
中是Hangfire方法:

public class Scheduler
{
    public void HangfireIoc()
    {
        BackgroundJob.Enqueue<MovieSaver>(x => x.SaveMovies());
    }
}
Startup.cs(在
Web
中)

我在
Core
中为Ninject提供了一个绑定类:

public class Bindings : NinjectModule
{
    public override void Load()
    {
        Bind<IMovieApi>().To<MovieApi>();
    }
} 
我不熟悉Ninject和IoC容器


有人能帮忙吗?

未加载
绑定
模块。尝试添加

kernel.Load<Bindings>();
例如:

kernel.Load(typeof(Startup).Assembly);

新的Ninject.Web.Common.Bootstrapper()内核:

Ninject.ActivationException

Error activating IMovieApi No matching bindings are available, and the type is not self-bindable.
 Activation path: 2) Injection of dependency IMovieApi into parameter api of constructor of type MovieSaver 
1) Request for MovieSaver Suggestions: 1) Ensure that you have defined a binding for IMovieApi. 
2) If the binding was defined in a module, ensure that the module has been loaded into the kernel. 
3) Ensure you have not accidentally created more than one kernel. 
4) If you are using constructor arguments, ensure that the parameter name matches the constructors parameter name. 
5) If you are using automatic module loading, ensure the search path and filters are correct.
kernel.Load<Bindings>();
kernel.Load(someAssembly);
kernel.Load(typeof(Startup).Assembly);
public void Configuration(IAppBuilder app)
    {            

        ConfigureAuth(app);

        GlobalConfiguration.Configuration
            .UseSqlServerStorage("ConnectString");

        GlobalConfiguration.Configuration.UseNinjectActivator(new Ninject.Web.Common.Bootstrapper().Kernel);


        app.UseHangfireDashboard();
        app.UseHangfireServer();

    }