Ok, cool. The issue is actually not with Turbine or Spark but with
Ninject (not slamming on it). This is due to the fact that Ninject
goes for the greedy constructors of any type. When Turbine resolves
all the IViewEngine, it just pings the underlying container for the
types. So when Ninject goes and tries to build SparkViewFactory it
uses the constructor that takes in a ISparkSettings instance. The
reason why Windsor works out of the box is because of how it handles
object construction. Since no ISparkSettings is ever registered it
knows to use the next constructor it discovered (the default one).
If you want to use Ninject with Spark and Turbine you'll need to do
this:
kernel.Bind<ISparkSettings>().ToMethod(context =>
(ISparkSettings)ConfigurationManager.GetSection("spark"));
You're setting a factory method for the ISparkSettings type and
resolving it the same way the SparkViewFactory greedy constructor
handles the instantiation of ISparkSettings.
Does this help?
On Aug 18, 6:05 pm, Epps <
epp...@gmail.com> wrote:
> Yes, the sample uses the WindsorServiceLocator, and the comment on the static ctor for mvcapplication mentioned Windsor did something special with the iviewengine initialization , thus the reason it was being used for the example. I am currently using Ninject, but it doesn't act the same way, unfortunately.
>
> I did plugin Windsor as in the sample, and it worked fine, but in the end was hoping to be able to wire up ninject in order to reuse some other registration components I already have written from other projects.
>
> --Sean
>