ASP.NET MVC 3 Preview 1 Released

Feels like just yesterday that we released ASP.NET MVC 2 to the world and here I am already talking about an early preview. In a way, we’re right on schedule. It was almost exactly a year ago that we released Preview 1 of ASP.NET MVC 2.

Today I’m happy to announce that ASP.NET MVC 3 Preview 1 is available for download. Give it a try out and let us know what you think. Some key notes before you give it a whirl:

  • ASP.NET MVC 3 Preview 1 tooling requires Visual Studio 2010
  • ASP.NET MVC 3 Preview 1 runtime requires the ASP.NET 4 runtime

As usual, to find out what’s in this release, check out the release notes. Also at the recent MVCConf, a virtual conference about ASP.NET MVC, I recorded a talk that provided a sneak peek at ASP.NET MVC 3 Preview 1. The audio quality isn’t great, but I do demo some of the key new features so be sure to check it out.

So what’s in this release that I’m excited about? Here’s a small sampling:

  • Razor View Engine which ScottGu wrote about recently. Note that for Preview 1, we only support the C# version (CSHTML). IN later previews, we will add support for the VB.NET version (VBHTML). Also, Intellisense support for Razor syntax in Visual Studio 2010 will be released later.
  • Dependency Injection hooks using service locator interface. Brad Wilson should have a few blog posts on this over the next few days.
  • Support for .NET 4 Data Annotation and Validation attributes.
  • Add View dialog support for multiple view engines including custom view engines.
  • Global Action Filters

In the next few days you should see more details about each of these areas start to show up in various blog posts. I’ll try to keep this blog post updated with relevant blog posts so you can find them all. Enjoy!

Related

What others have said

Requesting Gravatar... Miechu Jul 27, 2010 8:30 AM
# re: ASP.NET MVC 3 Preview 1 Released
Wow, that is kind of... fast... are there any chances that mvc3 tooling will be available for vs2008?
Requesting Gravatar... Matt Hidinger Jul 27, 2010 8:41 AM
# re: ASP.NET MVC 3 Preview 1 Released
@Miechu Unfortunately they said that MVC 3 takes a dependency on .NET 4 so VS 2008 support won't be coming.

@Haacked Downloading now! Looking forward to the metadata and validation improvements... the complex validation I have in my app using MVC 2 has grown to become some of my least favorite code, I will branch and spike out MVC 3 to see how much it could clean up the code.

Thanks for the preview!

-Matt
Requesting Gravatar... Tom Frey Jul 27, 2010 9:01 AM
# re: ASP.NET MVC 3 Preview 1 Released
@Haacked Is Intellisense for Razor supposed to be working in this preview? I followed the upgrade procedures and see the tooling support for Razor but don't get any Intellisense.
Requesting Gravatar... Matt Jul 27, 2010 9:23 AM
# re: ASP.NET MVC 3 Preview 1 Released
@Tom Frey In his MvcConf session, he said that there is no intellisense for Razor in Preview 1, but that it should be there by Preview 2.
Requesting Gravatar... Mike Jul 27, 2010 9:40 AM
# re: ASP.NET MVC 3 Preview 1 Released
Will you be releasing the Razor engine for MVC 2?
Requesting Gravatar... Nelson Jul 27, 2010 9:41 AM
# re: ASP.NET MVC 3 Preview 1 Released
What about syntax highlighting? It appears as if there is no tooling at all for cshtml files. Is this expected, or is my install broke?
Requesting Gravatar... Koistya `Navin Jul 27, 2010 9:47 AM
# re: ASP.NET MVC 3 Preview 1 Released
Great news! Downloading... Will Razor be the default choice as a view engine in ASP.NET MVC 3? (that would be cool)
Requesting Gravatar... Martin Jul 27, 2010 9:51 AM
# re: ASP.NET MVC 3 Preview 1 Released
@Nelson Your installation is not broken. How can you see on this page weblogs.asp.net/... ...there is no syntax highlighting in this version.
Requesting Gravatar... Joe Jul 27, 2010 9:53 AM
# re: ASP.NET MVC 3 Preview 1 Released
Ugh...for real? I literally just ordered the MVC2 book like...a week ago. It's not even here yet.

It's cool though - you keep putting new awesomeness out to be available to the masses. Keep it up!
Requesting Gravatar... Nelson Jul 27, 2010 9:58 AM
# re: ASP.NET MVC 3 Preview 1 Released
@martin: Thanks :) Scott Gu seemed to sneak that post by while I wasn't looking.

@phill: Awesome, I'v been looking forward to playing around with razor with ASP.net MVC for a while now. Keep up the awesome work with this project :)
Requesting Gravatar... haacked Jul 27, 2010 10:55 AM
# re: ASP.NET MVC 3 Preview 1 Released
Hi all, there is no Intellisense or syntax highlighting for Razor in Preview 1. That will come in a later release.

@Mike, there are no plans to release Razor for MVC 2. It requires ASP.NET 4 and MVC 2 is compiled against .NET 3.5 SP1.
Requesting Gravatar... Miechu Jul 27, 2010 11:32 AM
# re: ASP.NET MVC 3 Preview 1 Released
@haacked @matt

Well I don't know how things are done in mvc tooling but I don't see any reason that the tooling has to be .net 4 dependent, but even assuming that it is... wait.. just notice I can't develop .net 4 app with vs2008 (I was pretty sure I could)... hmmm... that sucks... well... keep up the great work and I'll check mvc3 sometime in the future ;)
Requesting Gravatar... g Jul 27, 2010 1:12 PM
# re: ASP.NET MVC 3 Preview 1 Released
Would be nice if MVC dropped server side view templates and threw everything at jquery-tmpl and script#, it would be nice to have a well supported GWT alternative, probably just pipe dreams at this point though.
Requesting Gravatar... Shiju Varghese Jul 28, 2010 1:10 AM
# re: ASP.NET MVC 3 Preview 1 Released
Congrats for the new release
Requesting Gravatar... Henning Anderssen Jul 28, 2010 1:33 AM
# re: ASP.NET MVC 3 Preview 1 Released
Great news.

When do you think the final release will be finished?
Requesting Gravatar... Marco P Jul 28, 2010 5:31 AM
# re: ASP.NET MVC 3 Preview 1 Released
awesome stuff, two requests!

1. Support for going in/out of HTTP in a DRY way.
2. RedirectToUrlResult which will either redirect to a specified url of look for a ReturnUrl (convention) in the params.
Requesting Gravatar... Rick Schott Jul 28, 2010 6:17 AM
# re: ASP.NET MVC 3 Preview 1 Released
Great post and thanks for the MVCConf talk.
Requesting Gravatar... James Snape Jul 28, 2010 7:03 AM
# re: ASP.NET MVC 3 Preview 1 Released
Hi Phil,

What is your intended ship vehicle for this - out of band or with the next Visual Studio?
Requesting Gravatar... Synapse Jul 28, 2010 7:58 AM
# re: ASP.NET MVC 3 Preview 1 Released
I'm kinda disappointed with this release.
I was hoping for real caching and support for editing multiple entities at once (like Django formsets) but MVC3 offers only minor improvements.
Requesting Gravatar... haacked Jul 28, 2010 11:17 AM
# re: ASP.NET MVC 3 Preview 1 Released
@James Snape: Out of band for sure since we'll release before the next version of Visual Studio. We'll probably also have a version of MVC in the next Visual Studio, but we don't know yet which version it will be. There's a lot of planning still going on.
Requesting Gravatar... Martin Wawrusch Jul 30, 2010 4:10 AM
# re: ASP.NET MVC 3 Preview 1 Released
Any chance we will see a F# version of Razor anytime soon?
Requesting Gravatar... Terry Jul 30, 2010 2:22 PM
# re: ASP.NET MVC 3 Preview 1 Released
Is it possible to mix ViewPage (aspx) and Razor (cshtml) within the same solution? Think it is. What about hooking Razor files up to existing master (.master) pages? Any way/workaround to pull that off? Or would I have to basically have a 'duplicate' of site.master (one ViewPage and one Razor layout file) if I wasn't ready to convert entire site to Razor view engine all at once?
Requesting Gravatar... Martin Jul 30, 2010 5:51 PM
# re: ASP.NET MVC 3 Preview 1 Released
What about performance ? Have you forgot about that or is it something that you are also working on?

I guess as more features come along, the performance will also degrade. Especially with the heavy use of Reflection and Expression Trees which i guess is the heaviest parts ?

Just want to know if any time/work is being put into that area ? :)
Requesting Gravatar... Denis Jul 31, 2010 11:22 AM
# re: ASP.NET MVC 3 Preview 1 Released
I'd like to see T4MVC integrated in asp.net mvc.

I mean, we all know that strongly-typed helpers are a great.
Requesting Gravatar... kad1r Aug 04, 2010 3:17 AM
# re: ASP.NET MVC 3 Preview 1 Released
Great new. I'm downloading right now.
Are there training videos to learn MVC3?
Requesting Gravatar... Felipe Lima Aug 11, 2010 10:47 AM
# re: ASP.NET MVC 3 Preview 1 Released
Phil,

I tried upgrading my MVC 2 project to MVC 3 preview 1 and ran into problems with my typed views. The ViewPage<T>.Model property stopped working and my project stopped running. It seems like the ViewPage<T> views were being treated as regular ViewPage classes and, thus, the Model property had a type = object. Maybe that is a issue you guys could take a look.
Thanks for the good work!
Felipe
Requesting Gravatar... Josh Williams Aug 17, 2010 8:52 AM
# re: ASP.NET MVC 3 Preview 1 Released
@Felipe: Same here - all my views are broken. My Model.<Class> accessors are no longer available for my custom viewdata. It's so soon I havn't seen any posts on resolutions for this.
Requesting Gravatar... Josh Williams Aug 17, 2010 9:39 AM
# re: ASP.NET MVC 3 Preview 1 Released
I think I found the issue (atleast for me) - my <%@ Import Namespace... %> messed it up for some reason. Once I removed these unused imports - it works fine. This could be a bug I guess? My import was for a simple Html Helper I made.
Requesting Gravatar... Feng Aug 19, 2010 4:47 AM
# re: ASP.NET MVC 3 Preview 1 Released
Any plan to add support for localization and theme
Requesting Gravatar... shawn Aug 24, 2010 2:35 PM
# re: ASP.NET MVC 3 Preview 1 Released
I commented a little while back, but it looks like it might have been eaten because it had a link in it. Are there any plans to add model binding support for updating objects with existing child collections? Right now if you call UpdateModel(model) on a model that has an initialized ChildItems collection, the model.ChildItems collection doesn't get updated properly. I'd be happy to submit a patch that is working for our scenarios.

I'd also love to see some sort of baked in support for using the [Key] data annotation (or equivalent unique/primary key in LinqToSql/EF) as an index key for items in collections to avoid concurrency errors.
Requesting Gravatar... Scotteg Aug 26, 2010 9:48 PM
# re: ASP.NET MVC 3 Preview 1 Released
Phil,

As for the name of the Dynamic View Object. I don't understand why the ViewData object itself can't just be give Dynamic traits. So people should be able to do this ViewData.Message = "Fred";.

Regards,

ScottEg
Requesting Gravatar... Deke Aug 31, 2010 2:06 PM
# re: ASP.NET MVC 3 Preview 1 Released
I am running into the same problem as Felipe. Whenever I add a <%@ Import Namespace=... %> to an apsx page the Model loses whatever it's type was and reverts back to being a plain old object. Any work arounds for this other than the obvious (don't use import) or am I doing something wrong here?
Requesting Gravatar... Deke Aug 31, 2010 3:18 PM
# re: ASP.NET MVC 3 Preview 1 Released
Actually found the work around over here http://forums.asp.net/p/1587136/4012958.aspx
for the Import Namespace problem

What do you have to say?

(will show your gravatar)
Please add 3 and 8 and type the answer here: