Take the 2-minute tour ×

Is there any way to run Ninject + NLog under an Azure Website without using the less performant Reflection based Injection?

var options = new NinjectSettings() { UseReflectionBasedInjection = true };

Is the problem stemming from a partial trust issue?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If Partial Trust is all you've got, Dynamic compilation is not possible so there simply is no other way. (Obviously if you were using Azure PaaS mode, you could switch to Full Trust but I guess that's not where you are)

Remember the overhead of DI is something that you should measure in the context of your whole solution - e.g. if you're doing 2 database roundtrips per request, that'll dwarf any impact of the reflection.

share|improve this answer
add comment

Your Answer


