2011-07-19 10 views
0

我有一組全局過濾器的autofac,分別來自IGlobalFilter篩選注射用MVC3

//knows how to add itself in filter collection 
abstract class GlobalFilter : IGlobalFilter {} 

class MyFilter : GlobalFilter, IRequestFilter{} 

public class GlobalFilterActionInvoker : ControllerActionInvoker {} 

這裏得到的是我autofac註冊

builder.RegisterType<MyFilter>().As<IGlobalFilter>(); 
builder.RegisterType<GlobalFilterActionInvoker>().As<IActionInvoker(); 
builder.RegisterControllers(assemblies).PropertiesAutoWired().InjectActionInvoker(); 

對於什麼都原因,我GlobalFilterActionInvoker的GetFilters方法沒有被調用。

這些組件的構造函數被稱爲指示autofac註冊成功!

如何解決此問題?

回答

2

發現問題。我們使用Glimpse(類似於螢火蟲的服務器端調試器)。他們有自己的控制吸菸者。這是重寫我的autofac註冊!

+0

你是如何解決這個問題的?你能設法讓Autofac和Glimpse一起工作嗎? – Fede

+0

最新版本的瞥見似乎已經修復了問題 – chandmk

+1

看起來它再次被破壞,使用MVC4和瞥見0.87 – chrisortman