ASP.NET-MVC2 Preview 1: Are There Any Breaking Changes?

后端 未结 4 564
长情又很酷
长情又很酷 2020-12-12 07:23
  1. I was following Steven Sanderson\'s \'Pro ASP.NET MVC Framework\' book.
  2. On page 132, in accordance with the author\'s recommendation, I downloaded the ASP.NET
4条回答
  •  轮回少年
    2020-12-12 07:56

    I had problems with Castle and MVC2 in VS 2010 Beta 2.

    I was able to get Castle working with this code for the GetControllerInstance. The problem was that all requests were coming into this (like css files), so just returning null for those seems to work.

    protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
    {
         if (controllerType == null) { return null; }
    
         return (IController)_container.Resolve(controllerType);
    }
    

    -Damien

提交回复
热议问题