Derik Whittaker



Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at
Upgrading to MVC Preview 4

Today I decided to sit down and upgrade the code to run on MVC preview 4.  To be honest I did not know exactly what to expect, and I have to say, it was kinda painful but not too bad.

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.

You can get the list of changes and the readme from here.
You can get other information about the MVC framework from codeplex or

Ok, on to the issues I ran into.

Problem: Assemblies not being correctly referenced.  The first hurdle I ran into was that VS did not want to accept my new MVC assemblies.  For some reason even though I had added them as a reference they were not being dropped into the bin directory.
Solution: All I needed to do was remove all the files from the bin in the solution and the Reference_Dependencies folders


Problem: The MVC team renamed RenderView to View
Solution: Global find and replace


Problem: Had to update the web.config because the version on System.Web.Abstractions and System.Web.Routing had changes
Solution: Find the few spots in the file and change the version from to

I was told by Chris Sutton that this was done with intent because SP1 of .Net 3.5 was about be released and the team did not want there to be any version issues.


Problem: All my viewdata references stopped working.  I have used the strongly typed ViewData feature a ton with MVC and all my references to it broke.
Solution: Prior to preview 4 I could do something like this in my codebehind:

Now you need to do this:

The change for this makes since, but it was a pretty painful change.


That about does it for my pain points in upgrading to preview 4.  I now need to spend some time giving the site a good run though to ensure I did not miss something.  Then it is off to gork all the new features and figure out how to use them :)

Till next time,

[----- Remember to check out DimeCasts.Net -----]

Posted 07-26-2008 1:30 PM by Derik Whittaker



Dave Schinkel wrote re: Upgrading to MVC Preview 4
on 07-26-2008 9:43 PM

This is why it's smart to wait until MVC is OUT of preview.  Unless you enjoy spending nights and weekends coding bleeding edge technology then more power to ya.  I just think that even though MVC rocks, it's not worth the time right now to put your time and energy into it until it's got a bit more mature, especially for a public website that's gonna have 2,000+ or so hits a day

Derik Whittaker wrote re: Upgrading to MVC Preview 4
on 07-26-2008 10:18 PM

Well, in terms of doing a major 'enterprise' site i may agree with you.

However, if everyone thought that way then there would be no-one testing the technology.  Think of the people using the MVC right now as the beta testers for the dev team.

The fact it took me about an hour was pretty nice.  A little painful, but not too bad.

All things equal i am glad i went with the MVC, Scott, Phil and gang are doing one hell of a job.

ASP.NET MVC Archived Blog Posts, Page 1 wrote ASP.NET MVC Archived Blog Posts, Page 1
on 07-27-2008 2:04 AM

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

Christopher Steen wrote Link Listing - July 27, 2008
on 07-28-2008 6:14 AM

Link Listing - July 27, 2008

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)