Subscribe to Windows IT Pro
December 07, 2010 10:26 PM

Beta Version of ASP.NET MVC 3 Is Out!

What's in ASP.NET MVC 3? Many enhancements, a new game-changing Razor view engine, and an important change to exception filters
Dev Pro
InstantDoc ID #129172
Rating: (4)

The ASP.NET team at Microsoft often appears to be on a rampage to get new versions of cool products out the door, and ASP.NET MVC could be their frequent-release poster child. No sooner had ASP.NET MVC 2 hit the download pages and into the Visual Studio 2010 installation package than Microsoft was already making a preview release of ASP.NET MVC 3 available far and wide. Or so it seemed at the time. In any case, less than a year after MVC 2 came, we're getting close to a final release of MVC 3.
 
This article is derived from some upcoming ASP.NET MVC courseware that I'm developing and writing for AppDev.

This frenetic pace for releases can cause havoc with development teams, who often have to carefully retest their code to see what breaks with the new versions of tools. This is particularly true for out-of-band releases like MVC 3, which, unlike MVC 2, wasn't tied to a major release or update of Visual Studio or the .NET Framework. The good news with MVC 3 is that, other than one breaking change (that we know about, anyway), MVC 3 is an add-on to MVC 2 that is fully backward compatible. All MVC 3 does is add features on top of MVC 2, so you should be able to move existing applications from MVC 2 to 3. The process isn't automated or simple, but it should keep working just fine. Assuming it worked before you made the transformation!
 
MVC 3 isn't quite the major release implied by a full increment of the version number, but it certainly has some features that make coding MVC applications far easier, along with some major new features that will change how you build those applications. The old saw about Microsoft finally getting a product right in version 3 doesn't really hold in this case—the original release of MVC 1 was pretty dang impressive and highly useable for development—but MVC has certainly come of age with this latest release. Other than its one major, game-changing feature—the new Razor view engine—most of the new features are refinements of old features or additional options that complement existing features. In some cases, this makes the existing feature more usable and sometimes even easier to understand.
 
The one potential downside to MVC 3 is that it requires that you use Visual Studio 2010—including the Express version—and .NET Framework 4.0. If you built an application using Visual Studio 2008 and .NET 3.5, you'll have to first upgrade to Visual Studio 2010 and .NET 4.0 before upgrading from MVC 2 to MVC 3, and that may deter you for a while. But if the application is already Visual Studio 2010 and .NET 4.0, we really don't see any reason not to make the switch to MVC 3.
 
Breaking Change: Exception Filters
The one known breaking issue in MVC 3 is that Microsoft changed the order in which exception filters execute. This probably won't be a major issue for most MVC applications, and is only an issue if they use explicit exception filters with the Order properties set to the same value. The only built-in exception filter is HandleError, which checks the HTTP status code to see if it is 500 (internal server error) in order to handle otherwise unhandled exceptions. But this change also affects any custom exception filters in an application.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.