We are planning to release the next public preview of
ASP.NET MVC at the MIX 08 conference in a few weeks. This build will be
available for anyone on the web to download (you do not need to attend MIX to
get it). We have incorporated a lot of early adopter feedback into this
release. Below are some of the improvements that will appear with this
next preview release:
1) The ASP.NET MVC Framework can be deployed in the
\bin directory of an app and work in partial trust
The first ASP.NET MVC preview release required a setup
program to be run on machines in order for the System.Web.Mvc.dll assembly to
be registered in the machine's GAC (global assembly cache).
Starting with this upcoming preview release we will enable
applications to instead directly reference the System.Web.Mvc.dll assembly from
the application's \bin directory. This means that no setup programs need
to be run on a sever to use the ASP.NET MVC Framework - you can instead just copy
your application onto a remote ASP.NET server and have it run (no registration
or extra configuration steps required).
We are also doing work to enable the ASP.NET MVC framework
to run in "partial/medium trust" hosting scenarios. This will
enable you to use it with low-cost shared hosting accounts - without requiring
the hosting provider to-do anything to enable it (just FTP your application up
and and it will be good to run - they don't need to install anything).
2) Significantly enhanced routing features and
infrastructure
One of the most powerful features of the ASP.NET MVC
framework is its URL routing engine (I covered some of these features here).
This upcoming ASP.NET MVC preview release contains even more
URL routing features and enhancements. You can now use named routes
(enabling explicit referencing of route rules), use flexible routing wildcard
rules (enabling custom CMS based urls), and derive and declare custom route
rules (enabling scenarios like REST resources mappings, etc).
We have also factored out the URL routing infrastructure
from the rest of the MVC framework with this preview, which enables us to use
it for other non-MVC features in ASP.NET (including ASP.NET Dynamic Data and
ASP.NET Web Forms).
3) Improved VS 2008 Tool Support
The first ASP.NET MVC preview had only minimal VS 2008 support (basically just simple project template support).
This upcoming ASP.NET MVC preview release will ship with
improved VS 2008 integration. This includes better project item
templates, automatic project default settings, etc. We are also adding a
built-in "Test Framework" wizard that will automatically run when you
create a new ASP.NET MVC Project via the File->New Project dialog.
This will enable you to easily name and wire-up a unit test project for your
ASP.NET MVC application.
The ASP.NET MVC test framework wizard is pluggable and will
enable custom unit test project templates to be added to its list of supported test options:
Figure 1

This will enable developers to easily choose whichever unit
testing framework (and associated mocking and dependency injection options)
they prefer to use.
4) [ControllerAction] Attribute No Longer Required on
Controller Action Methods
The first ASP.NET MVC preview release required action
methods on Controller classes to be explicitly marked with a [ControllerAction]
attribute to be callable:
Figure 2

Based on early-adopter feedback, the upcoming ASP.NET MVC
release removes this requirement. Instead by default all public methods
on a Controller will now be considered Action methods:
Figure 3

Note: You can optionally add attributes to block public
methods on your Controller from being callable as actions if you want/need to
add a public non-action method on it.
5) New Filter Attribute Support for Controllers and
Action Methods
One of the new extensibility features enabled with this next
ASP.NET MVC release is a feature called "Filter Attributes".
These enable you to inject code interceptors into the request of a MVC
controller that can execute before and after a Controller or its Action methods
execute. This capability enables some nice encapsulation scenarios where
you can package-up and re-use functionality in a clean declarative way.
For example, I could use an [OutputCache] filter attribute
to output cache my product listing page for 30 seconds at a time:
Figure 4

Or use an [Authorization] filter attribute to
ensure that only people within a specific security role are allowed to Edit a
product:
Figure 5

The filter mechanism is extensible, and you can easily
create your own custom filter attributes for Controller classes or Action
methods with it. Filters (and controllers/actions that use filters) can
be fully unit tested.
6) HTML Helpers Built-in
The first ASP.NET MVC preview had only a few HTML UI helper
methods built-into the core assembly. We then shipped a separate download
that included a bunch of additional HTML helper methods you could optionally
use.
This upcoming ASP.NET MVC preview now has these HTML helper
methods built-in (no separate download required). Next month we are also
going to start to talk about some of the new enhancements to the client-side
ASP.NET AJAX libraries we are making, as well as some of the AJAX helper
methods we will build to enable it to easily integrate with ASP.NET MVC.
7) Lots of Refactoring and Design Improvements
This upcoming ASP.NET MVC preview includes several
refactoring and design improvements that make the MVC framework more extensible
and testable. In general the team has followed a philosophy where for all
features you have three options:
Use the built-in features/implementations "as-is"
out of the box
Slightly customize the built-in features/implementations
without having to write much code
Completely swap out the built-in features/implementations
for custom ones
For example: you can now override the ViewEngine locator
logic without having to override the ViewEngine execution logic (and vice-versa)
- or alternatively swap out ViewEngines entirely. The Controller Factory support has been extended to make it even easier to integrated with dependency injection
frameworks. Route rules are now fully extensible. Controllers are
more easily testable, etc.
8) Downloadable ASP.NET MVC Framework Source that can
be Built and Patched
Last month I announced that the .NET Framework source code can now be downloaded and debugged.
Ultimately once it ships the ASP.NET MVC framework will be available via this
mechanism as well (just like the rest of the ASP.NET source code).
Starting with this next preview, we are also going to make
the ASP.NET MVC Framework source code downloadable as a buildable VS project
solution. This will enable you to easily view and debug the ASP.NET MVC
Framework source code. We are also going to include a license that
permits you to optionally make patches to the ASP.NET MVC Framework source code
in the event that you run into a bug in an application you are developing with
it.
The license won't enable you to redistribute your patched
version of ASP.NET MVC (we want to avoid having multiple incompatible ASP.NET
MVC versions floating around and colliding with each other). But it will
enable developers who want to get started building ASP.NET MVC applications
immediately to make progress - and not have to worry about getting blocked by
an interim bug that they can't work around.