Windsor在MVC 3中解析IViewEngine
使用 Windsor 2.5.1.0 将其放在 Global.asax 中
_windsor.Register(
Component.For<IViewEngine>().ImplementedBy<RazorViewEngine>(),
);
紧接着执行此操作时:
IViewEngine tt2 = _windsor.Resolve<IViewEngine>();
int count = ((RazorViewEngine) tt2).ViewLocationFormats.Length;
count 变量为 0,但使用此:
IViewEngine tt2 = new RazorViewEngine();
int count = ((RazorViewEngine) tt2).ViewLocationFormats.Length;
它是 4,这是默认值。我不明白为什么温莎实例返回零?
有人有建议吗?
Have this in Global.asax using windsor 2.5.1.0
_windsor.Register(
Component.For<IViewEngine>().ImplementedBy<RazorViewEngine>(),
);
When executing this right after:
IViewEngine tt2 = _windsor.Resolve<IViewEngine>();
int count = ((RazorViewEngine) tt2).ViewLocationFormats.Length;
The count variable is 0, but with this:
IViewEngine tt2 = new RazorViewEngine();
int count = ((RazorViewEngine) tt2).ViewLocationFormats.Length;
It is 4, which is the default. I cannot see why the windsor instance is returning zero?
Anyone have a suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在寄存器之前:
这给出了错误。沃
I had before the registers:
Which gave the error. Wo