I have an MVC4 project in which I am using Ninject as the DI Framework. The problem I am having is trying to split my DI bindings from my implementation as i do not want my main web project to reference all of my other projects.
I have tried to create a separate project called Bindings which contains ninject modules:
public class WebModuleBindings : NinjectModule
{
public override void Load()
{
Bind<IStaticDataRepository>().To<StaticDataRepository>();
}
}
I then load this DLL dynamically in my web project:
kernel.Load(bindingDll);
This works fine when i run it locally but when i use msbuild and deploy my application the bindings project dll is not included as it is not referenced anywhere.
What is the best way to solve this problem?