If any more details are needed I can provide them, Thanks
Are you calling ViewEngines.Engines.Clear first?
You can "stack" view engines, so it's possible the default engine is
picking up the request first.
I actually have 3 engines stacked using ninject to get all all
bindings for IViewEngine without any issues.
public class MvcApplication : NinjectHttpApplication
{
protected override void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/
{id}", // URL with parameters
new { controller = "Client", action = "Index", id =
"" } // Parameter defaults
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
InitializeNinject();
System.Web.Mvc.ViewEngines.Engines.Clear();
System.Web.Mvc.ViewEngines.Engines.Add(new
WebFormThemeViewEngine());
}
public void InitializeNinject()
{
//NinjectKernel.Initialize(new
ControllerModule(Assembly.GetExecutingAssembly()));
ControllerBuilder.Current.SetControllerFactory(typeof(NinjectControllerFactory));
}
protected override IKernel CreateKernel()
{
IModule[] modules = new IModule[]
{
new
AutoControllerModule(Assembly.GetExecutingAssembly()),
new SnapModule()
};
return new StandardKernel(modules);