I've just gone through the process of upgrading Suteki Shop, my open source eCommerce application from MVC Framework Preview 4 to the Beta. Yes, I know, I missed out Preview 5 all together, so my experiences are going to be different from someone just moving from Preview 5 to the Beta.
Here's a brief rundown of what was involved:
- Download and install the MVC Beta
- Get the latest MvcContrib trunk and build it. It already references the MVC Beta assemblies, so there's no need to copy them in.
- Copy all the MVC Beta, MvcContrib and Castle assemblies into my 'Dependencies' folder.
- Make sure all the MVC Beta assemblies are marked as 'Copy Local'. I don't want to have to install them in the GAC on my server.
Now as expected, when I built the solution I got a ton of exceptions. Here's what I needed to do to get it to build:
- Most HtmlHelper extension methods have been moved to the System.Web.Mvc.Html namespace, so I had to add a using statement to any file which referenced ActionLink.
- ActionLink<T> now lives in the futures assembly: 'Microsoft.Web.Mvc' so I had to add using statements where appropriate.
- I had to add my own implementation of 'ReadFromRequest' to my own ControllerBase class as this has been removed from Controller.
- I had to fully qualify the namespace of my ControllerBase class because there is now a ControllerBase in the MVC Framework.
I also had to make the following changes to the Web.config file:
- Change the version number of System.Web.Abstractions to 22.214.171.124
- Change the version number of System.Web.Routing to 126.96.36.199
- Add the namespace 'System.Web.Mvc.Html'
There were also some changes to the views:
- Html.Form has been renamed to Html.BeginForm.
- Html.Checkbox's signature has been changed.
With all the changes made the software now builds and runs. But that's not the end of the story. It works, but it's coded in a very Preview 1 style. I'm planning to do a major refactoring over the Christmas holidays to use all the Beta goodness that been introduced and that will mean changing the way most of the controllers work and re-doing most of the views. Should be fun :P