Still not officially announced by anybody inside Microsoft, but quietly this morning the first preview of ASP.NET MVC 3 appeared on Microsoft Download.

And it’s exactly what everyone was expecting after last month’s announcement of Scott Guthrie of Razor, the new view engine for ASP.NET MVC.

What else does this new version bring to the table?

First of all it takes a dependency on .NET4. It means that you cannot be able to use it unless you migrate you applications to the latest version of the .NET framework (and if the story repeats itself, with the RTM coming out next year, this won’t be a big deal). And it also means that finally the framework can use all the cool features of C#3, like the dynamic keyword and the new features of .NET4 like the new data annotation’s attributes

  • Razor: already announced a few weeks ago by ScottGu, it’s a new view engine that tries to make it easier to mix code and HTML
  • Dynamic View and ViewModel: now you will be able to use “dynamic” view model and pass them to a view, without using the ugly hashtable approach. At the end of the day it’s still the same thing (no compile-time checking) but at least you don’t see all that ugly “magic strings” around
  • Global Filters: in ASP.NET 2, if you need to apply a filter to all your controllers you have to apply it to you own base controller, and have all your controller inherit from it (actually you could also apply the same attribute to all your controllers if you like writing lot of repetitive code). Now you can just register the global filters in the application startup, just like you do now with the modelbinders or view engines and so on
  • Dependency Injection support: this is probably the most important feature introduced with this release: the ability to use your favorite IoC Container (using the Common Service Locator) to create controllers, factories, views, filters and so on. Brad Wilson has a great series of posts about that.

It was just a very quick recap: I’ll follow-up with a more detailed post in the next days.

Now, run and download the preview and play with it.