ASP.NET MVC Framework on the Polymorphic Podcast

If you don’t care about podcasts, stop reading now.  If you don’t care about ASP.NET MVC, stop reading now.  If you haven’t stopped reading, then please continue. :-), and subscribe to my feed at

Craig Shoemaker recently interviewed me on the Polymorphic Podcast regarding the MVC Framework and the MvcContrib project.

I, along with Ben Scheirman and Dave Verwer, are writing ASP.NET MVC in Action for Manning, and I talk a little about that.

I spoke a lot about MvcContrib.  I really have to brag on the folks contributing to MvcContrib and to Eric Hexter, who does a lot of work to keep that project’s CI setup going.  Here’s the latest build report below.  If you are curious how you can get nearly 1000 unit tests runing in an automated build and have it run in less than 3 minutes, pull down the source and see how the build and tests are put together.


CruiseControl.NET Build Results for project MVCContrib (web page)



Date of build:
2008-03-19 13:43:57

Running time:

Integration Request:
IntervalTrigger triggered a build (IfModificationExists)

Last changed:
2008-03-19 13:43:29

Last log entry:

Patch #1003 - kbaley
Patch includes:
- the ability to use TestControllerBuilder with controllers that have constructor arguments
- associated unit test

Tests run: 802, Failures: 0, Not run: 0, Time: 40.704 seconds

All Tests Passed

Modifications since last build (4)

ASP.NET MVC Framework big changes since Dec CTP

 For more stuff on ASP.NET MVC, subscribe to my feed:

If you installed the December CTP of the ASP.NET MVC Framework, you had to install it.  The assembly was registered with the GAC, and you didn’t have to deploy the assembly.  The original plan was to release the MVC Framework with a service pack of .Net 3.5.  That is no longer the plan.

In the March CTP, System.Web.Mvc.dl, System.Web.Routing.dll, and System.Web.Abstractions.dll can all be deployed to the bin folder.  They don’t require the GAC.  I like that a lot.  I recently deployed using the March CTP drop of the MVC Framework.  I have .Net 3.5 on the web server, and it was super simple. 

Routing is a bit different.   Make sure to change [controller]/[route] to {controller}/{route}.  Minor change.  Overall, I’m actually using to using {} for tokens because of all the NAnt build work I’ve done (NAnt uses ${prperty}).

Routing can be used with existing apps.   If you have every done url rewriting (I have), you know how painful it can be.  Now that routing is in a separate assembly, you can use it with any ASP.NET app you wish.  I really like that concept because routing doesn’t care if you are using the mvc handler or page hander.  It works for parsing urls either way.

Overall, I’m pretty impressed with this CTP (and it is a CTP).  It is not done yet, and Microsoft makes no claims that it is complete.  It’s the second public drop of a new, fledgling framework.  The core, in my opinion, is the routes, controllers, and handoff to the views.   All the other stuff is ancillary.  Once the core is there, libraries like MvcContrib can start adding on extra features.  For instance, I’m looking at leveraging the presentation object validators from the Castle project along with the [DataBind] attribute.  It shouldn’t be to hard to leverage the Castle project here, even while using a different controller base class.  I think they are quite complimentary, and Monorail has so many great features, I don’t think I’ll use the MVC Framework bare. 

Let me know in a comment if you are interested in me releasing the source for

New drop of ASP.NET MVC Framework now available

My RSS feed:

You can download it here.  It’s public and announced at the MIX conference.  A new release of the ASP.NET MVC Framework.  The license allows  you go “go live” and use it in production.  You’ll have to uninstall the December CTP first.  The new install will only drop the assemblies in C:Program FilesMicrosoft ASP.NET MVC Preview 2Assemblies, and then you’ll have to copy them over to your application and drop them in the “bin” folder.

We’ll be upgrading MvcContrib and CodeCampServer to work with the new bits soon.

From looking at the bits, here are some notable changes:

  • Constructor of Route now takes more information (GOOD)
  • There are IDictionary arguments for many things, and that is a GOOD thing.  Before anonymous types were required.
    I like the way Monorail handles this by allowing querystring syntax like: RedirectToAction(“foo”, new string[] {“orderid=” + theOrder.Id});
  • [ControllerAction] is gone.  Public methods are actions by default. (GOOD)
  • RenderView() methods are still protected and only 1 of them is virtual (would like IViewEngine to be used more explicitly)
  • 6 (SIX) members of the Controller class are still marked internal (I’d like to be able to extend them)
  • RouteValueDictionary is just a wrapper for the anonymous type.  (I think we can work towards a better API)
  • Seven properties don’t have setters, such as IPrincipal User {get;} (I’d like to see setters)
  • I still see SEALED classes.  In an extensible framework, sealed is your enemy (I’ll be making not of the sealed classes I’d like to extend)
  • ViewContext is not usable in unit test scenario because of its dependency on HttpContextBase. (It can be refactored to help testability)
    Still can’t mock out the IViewEngine’s RenderView method and have it work in a unit test.  I’m told the team is tackling this next.
  • ComponentController is a welcome addition to enable nested controllers, but, sadly, non of the members are virtual.
  • Lots of view helpers (GOOD)
  • Routing is a separate assembly (GOOD)
  • System.Web.Mvc.dll can be deployed in the bin instead of the GAC (GOOD)
  • We can go live with this drop (and it appears to me to be stable enough for small applications)
  • The team is committed to roughtly 6 weeks in between drops (GOOD).  Release early.  Release often.