Like many other nerds (sorry people, lets face we are nerds :) ), as soon as I heard that MVC Preview 5 had been released I wanted to run out and upgrade Dimecasts.net.
Let me first start off by saying this. Anyone that decides to build a production application of any size on a Technology Preview must be willing to accept breaking changes between releases. Please do not take this post as me 'bitching' or 'complaining'. This post is just to help others that may be about to do the same thing.
Here are the conversion issues I ran into:
Issue #1:
Since the new assemblies are now versioned again I needed to update the web.config to reflect 3.5.0.0
Solution:
Spend 3 seconds changing the web.config
Issue #2:
The decision was made by the MVC team to remove RenderUserControl and replace it with a more generic RenderPartial. Now they both do the same thing in principal, but act in a slightly different way. Because RenderPartial does not return any html (it writes it directly to the output stream) you need to change the syntax to call it.
Solution:
Replace all instances of RenderUserControl with RenderPartial as well as change the syntax.
Old Syntax
<% = Html.RenderUserControl(......) %>
New Syntax
<% Html.RenderPartial(......); %> // No = sign and added ;
Issue #3:
The HTML Helper ActionLink was changed to no long support the use of generics/lambda expressions. This was done because you can not assume route information based on generics/lambdas and this could cause issues in the future
Solution:
Make the needed and painful change all over the code.
Issue #4:
Most of the HTML Helper's for text entry (text box, text area, etc) was changed to no longer accept html attributes such as width, height, cols, etc. This was done with good intent and was the right move.
Solution:
Now in order to supply html attributes you need to use the overload that allows you to provide an anonymous object with the information.
ie -- new { width = 25, height = 20 }
All in all the upgrade was not all that painful. I think it took me about 1 hour, nothing major. Actually took me about as long to regression test the site as it did to make the actual changes.
I hope this helps someone else that is making the change.
Till next time,
[----- Remember to check out DimeCasts.Net -----]