Are there facilities in NInject that will allow me to load services from other modules (assemblies) on demand like it s done in Unity?
Having a .NET assembly, how can I detect whether it was built for .NET CF or a full framework?
Are there facilities in NInject that will allow me to load services from other modules (assemblies) on demand like it s done in Unity?
I m pretty sure this is what you re looking for:
var kernel = new StandardKernel();
kernel.Load( Assembly.Load("yourpath_to_assembly.dll");
If you look at KernelBase with reflector in Ninject.dll you will see that this call will recursively load all modules in the loaded assemblies (Load method takes an IEnumerable)
public void Load(IEnumerable<Assembly> assemblies)
{
foreach (Assembly assembly in assemblies)
{
this.Load(assembly.GetNinjectModules());
}
}
I don t quite understand what you mean by "Like Unity" but you can do a few different things for loading assemblies. Ninject itself will load local assemblies for extensions/plugins by default. Ninject can also load NinjectModule classes from assemblies. If you want to do something more complex, you can use the Ninject.Extensions.Conventions project to do a lot of different scanning and type binding.
If you re referring to loading Assemblies non-statically out of the box, no it doesnt.
There are many other questions on this, e.g., Using Ninject in a plugin like architecture
Having a .NET assembly, how can I detect whether it was built for .NET CF or a full framework?
In the build process for a .NET C# tool, I have been using ILMerge to merge the assemblies into a single exe. I added a new class library recently, and now the ILMerge is failing. I have remembered ...
It s possible to use the same strong name key for multiple related projects/assemblies. I m interested to know whether there are any drawbacks to using this approach. SPecifically, can it lead to a ...
I m developing a project where users need to build reporting queries using complex Linq statements to generate data sets. The best way I could think of to compile these user-generated queries and ...
换言之,如果我有一份汇编的批量档案,是否找到(利用反思)这一批量是否来自网络应用、级图书馆或另一个项目类型? ......
I have an e-commerce website that is already up and running for some time. It s built on .NET 3.5. So far, so good. The "problem" is that now I need to start sharing functionality (products list, ...
My Visual Studio 2008 project references two (external) assemblies (A+B) both of which happen to be referencing the same third assembly (C). However, assembly A expects assembly C to have a public key ...
Are there facilities in NInject that will allow me to load services from other modules (assemblies) on demand like it s done in Unity?