ASP.NET的MVC2 preVIEW 1:是否有任何重大更改? [英] ASP.NET-MVC2 Preview 1: Are There Any Breaking Changes?

查看:217
本文介绍了ASP.NET的MVC2 preVIEW 1:是否有任何重大更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我是史蒂芬之后桑德森的临ASP.NET MVC框架的书

  2. 在132页,按照笔者的建议,我下载了ASP.NET MVC期货组装,并将其添加到我的MVC项目。

  3. 然后的未经作者的鼓励的,我下载,安装并注册成立了ASP.NET MVC2 preVIEW 1 dll文件到我的项目。

  4. 现在,我再也不能下载该网站。

    1. 也就是说,当我在Visual Studio中按F5键,我得到<一个href=\"http://stackoverflow.com/questions/1355464/asp-net-mvc-no-parameterless-constructor-defined-for-this-object\">this错误。


在回想起来,我认为这是一个非常糟糕的主意假设ASP.NET MVC2 preVIEW 1只会添加剂;但我想其他人在权衡。

有没有人注意到任何重大更改ASP.NET MVC 2 preVIEW 1?

另外 - 有没有人注意到任何更改影响温莎城堡

另外,请让我知道如果我应该铭记的IIS6 IIS7与后果。


解决方案

我在VS与城堡和MVC2问题2010 Beta 2中。

我能得到城堡与此code为GetControllerInstance工作。问题是,所有的请求都进入这个(如CSS文件),所以只要返回null那些似乎工作。

 保护覆盖一个IController GetControllerInstance(RequestContext的RequestContext的,类型controllerType)
{
     如果(controllerType == NULL){返回NULL; }     回报(一个IController)_container.Resolve(controllerType);
}

-Damien

  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 MVC Futures assembly, and added it to my MVC project.
  3. Then, without encouragement from the author, I downloaded, installed, and incorporated the ASP.NET MVC2 Preview 1 dlls into my project.
  4. Now, I can no longer load the website.

    1. That is, when I hit F5 in Visual Studio, I get this error.

In retrospect, I think it was a really bad idea to assume that ASP.NET MVC2 Preview 1 would only be additive; but I'd like other people to weigh in.

Has anyone noticed any breaking changes in ASP.NET MVC 2 Preview 1?

Also - Has anyone noticed any changes that impact Castle Windsor?

Also, please let me know if I should be mindful of IIS6 vs. IIS7 ramifications.

解决方案

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

这篇关于ASP.NET的MVC2 preVIEW 1:是否有任何重大更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆