Updating an ASP.NET MVC App to Preview 2

Posted by on in Blogs
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:

  1. Remove the assembly from your project.

  2. 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.

  3. Just to keep you on your toes, System.Web.Mvc.BindingHelperExtensions will probably be renamed soon.

  4. RedirectToAction is now in System.Web.Routing. Edit your controllers.

  5. RedirectToAction now takes a RouteValueDictionary instead of an anonymous type. You can stuff your old anonymous type into the constructor for RouteValueDictionary.

  6. 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.


Comments

Check out more tips and tricks in this development video: