Updating an ASP.NET MVC App to Preview 2
There's a whole lot of ground not covered in the
official update instructions.
The
MVC Web UI helpers are now in the framework. But they've changed quite a bit. So you must:
- Remove the assembly from your project.
- UpdateFrom is no longer an extension method. It's now a static method in
System.Web.Mvc.BindingHelperExtensions
. So you have to change anywhere you called that.
- Just to keep you on your toes,
System.Web.Mvc.BindingHelperExtensions
will probably be renamed soon.
- RedirectToAction is now in
System.Web.Routing
. Edit your controllers.
- RedirectToAction now takes a RouteValueDictionary instead of an anonymous type. You can stuff your old anonymous type into the constructor for RouteValueDictionary.
- If you have unit tests you have to update that project, too. In a big way. All that stuff Phil Haack had on his blog as a download a while back is now in the framework. IHttpContext is now HttpContextBase. I'm still figuring this stuff out. I may have to rebuild the unit tests from scratch.
I think it's fair to say that the unit test portion of MVC is in even greater flux than the rest of the framework at present.