ASP.NET MVC 2 RC Released

Paternity leave is not all fun and games. Mostly it’s soothing an irate baby and toddler while dealing with explosive poo episodes. Believe me when I say the term “blow out” is apt. That’s probably not the imagery you were hoping for in a technical blog post, but I think you can handle it. ;)066 What!? It’s already time for an RC?! I think I need to be changed.

While I’m on leave, the ASP.NET MVC team continues its hard work and is now ready to announce the release candidate for ASP.NET MVC 2. Go get it now!

Download ASP.NET MVC 2 Release Candidate

As always, the release notes provide a summary of what’s changed. Also, stay tuned as I expect we’ll see one of those epic ScottGu blog posts on the release soon.

Highlights

As you might expect from a release candidate, most of the work focused on bug fixes and improvements to existing features. We also spent a lot of time on performance profiling and optimization.

Much of the focus on this release was in the client validation scripts. For example, the validation script was moved into its own file and can be included at the top or bottom of the page. Client validation also now supports globalization.

The other change related to validation is that the ValidationSummary now supports overloads where only model-level errors are displayed. This is useful if you are displaying validation messages inline next to each form field. Previously, these messages would be duplicated in the validation summary. With these new changes, you can have the summary display an overall validation message (ex. “There were errors in your form submission”) as well as a list of validation messages which don’t apply to a specific field.

What’s Next?

RTM of course! The RTM release of ASP.NET MVC will be included in the RTM release of Visual Studio 2010, which is slated for some time in March. The VS2008 version of ASP.NET MVC 2 might release earlier than that. We’re still working out those details.

What others have said

Requesting Gravatar... Javier Lozano Dec 17, 2009 6:37 AM
# re: ASP.NET MVC 2 RC Released
Nice pic! :) She's getting big!
Requesting Gravatar... Javier Lozano Dec 17, 2009 6:44 AM
# re: ASP.NET MVC 2 RC Released
Here's an actual tech related comment... :)

Are you guys planning on releasing the .NET 4 bits too?
Requesting Gravatar... Sergio Pereira Dec 17, 2009 6:46 AM
# re: ASP.NET MVC 2 RC Released
Happy to see 2 RC's for ASP.NET MVC in less than a year. That's another important selling point for us trying to introduce MVC in our organizations.
That picture caption looks more like: "What? My dad is releasing software during my paternity leave? How did I get assigned to this family?"
Requesting Gravatar... Mark Harrison Dec 17, 2009 6:51 AM
# re: ASP.NET MVC 2 RC Released
Just installed the RC, and theres no out of the box support for area manifests in the projects from preview 2, any hints on how to get it up and running?
Requesting Gravatar... Erik Dec 17, 2009 6:53 AM
# re: ASP.NET MVC 2 RC Released
"Believe me when I say the term “blow out” is apt." - MAN do I know how you feel. Hah!

Grats on the RC - I can't wait to check it out. =)
Requesting Gravatar... Elijah Manor Dec 17, 2009 7:00 AM
# re: ASP.NET MVC 2 RC Released
Awesome! Thanks for the update.

Will the install support VS 2010 tooling or is that reserved for the final product that will be shipped with VS 2010 in March?

Thanks again!
Requesting Gravatar... Fredrik Dec 17, 2009 7:29 AM
# re: ASP.NET MVC 2 RC Released
Awesome! Thanks for the RC :)
Requesting Gravatar... Felipe Lima Dec 17, 2009 7:35 AM
# re: ASP.NET MVC 2 RC Released
Great work Phil! Thanks a lot!
Requesting Gravatar... Raj Dec 17, 2009 7:38 AM
# re: ASP.NET MVC 2 RC Released
Web Platform Installer does not show MVC 2 as a download
Requesting Gravatar... Ali Dec 17, 2009 7:48 AM
# re: ASP.NET MVC 2 RC Released
What a fast installation ! Whats the trick Phil ? previous versions took longer installation
Requesting Gravatar... josh Dec 17, 2009 7:53 AM
# re: ASP.NET MVC 2 RC Released
caption: 'I've got a release candidate for you, dad'

/yep, i'm an geek
Requesting Gravatar... Yitzhak Dec 17, 2009 7:54 AM
# re: ASP.NET MVC 2 RC Released
Great news.

What about corresponding ASP.NET MVC Futures?
What functionality, if any, was moved from the Futures to the main trunk?

Regards,
Yitzhak
Requesting Gravatar... Charles Williams Dec 17, 2009 8:22 AM
# re: ASP.NET MVC 2 RC Released
After 4 kids, I know the term: "containment breech" well. Mazeltov.

On a more technical note, do you know of a way to handle dependent required fields? I was thinking of implementing a [RequiredIfAttribute]

Requesting Gravatar... Andrew Davey Dec 17, 2009 9:14 AM
# re: ASP.NET MVC 2 RC Released
Can someone explain how to get jQuery validation working with this release? It seems like lots has changed/moved since previous releases - making it very hard to get a straight answer from Google!
Thanks.
Requesting Gravatar... Wayne Brantley Dec 17, 2009 9:18 AM
# re: ASP.NET MVC 2 RC Released
Lots of bugfixes - the release notes mention 3 of them. Bug fix rate must be slowing with holidays. :-)

Release notes say you CANNOT have VS2010 beta installed! Ugh.

What about the source for MVC and futures? Codeplex was not updated.

Thanks for the update though!


Requesting Gravatar... Jeffrey Palermo Dec 17, 2009 9:20 AM
# re: ASP.NET MVC 2 RC Released
Thanks for being so quick about it
Requesting Gravatar... Nathan Roe Dec 17, 2009 9:27 AM
# re: ASP.NET MVC 2 RC Released
When will the source code and futures assembly be released?
Requesting Gravatar... Koistya `Navin Dec 17, 2009 9:35 AM
# re: ASP.NET MVC 2 RC Released
Great news!
Requesting Gravatar... Wayne Brantley Dec 17, 2009 9:38 AM
# Client Validation Help
This code no longer compiles - so I guess no longer required.
<% ViewContext.FormContext.ClientValidationFunction = "EnableClientValidation"; %>

However, removing it makes client validation not work. No source, no docs, not sure what to do.
Requesting Gravatar... Eilon Lipton Dec 17, 2009 10:01 AM
# re: ASP.NET MVC 2 RC Released
Hi everyone - Both MVC Futures and the source code will be released later today on CodePlex. Please stay tuned!

The MVC Futures download will include the jQuery Validation adapter as well as the Areas Build Task that were removed from the official product.

Thanks,
Eilon
Requesting Gravatar... BuzzBox Dec 17, 2009 10:05 AM
# re: ASP.NET MVC 2 RC Released
Again no support for VS10 Beta2???
Requesting Gravatar... Eilon Lipton Dec 17, 2009 10:15 AM
# re: ASP.NET MVC 2 RC Released
Regarding Visual Studio 2010 and .NET 4 support, that is unfortunately not a feasible option. The most recent public release of VS2010 and .NET 4 is Beta 2. However, our internal builds of MVC 2 for VS2010 and .NET 4 depend on features that were available only after Beta 2. In other words, if we released what we have right now for VS2010 and .NET 4 then it wouldn't even run.

The alternative would be for us to keep building a version of MVC 2 for VS2010 and .NET 4 Beta 2, but that was too much extra effort for a very small ASP.NET MVC team :(
Requesting Gravatar... BuzzBox Dec 17, 2009 10:30 AM
# re: ASP.NET MVC 2 RC Released
So what version of MVC2 is in VS10B2? Preview2? - I'm thinking shall I go with RC on VS2008 or whatever version is in VS2010?
Requesting Gravatar... Eilon Lipton Dec 17, 2009 10:48 AM
# re: ASP.NET MVC 2 RC Released
Visual Studio 2010 Beta 2, which is the most recent public version of VS2010, contains ASP.NET MVC 2 Preview 2.

The out-of-band standalone releases of ASP.NET MVC 2 for Visual Studio 2008 SP1 are not compatible with VS2010 and also cannot be installed on the same computer. For the time being you'll either have to pick whether you want to use VS2008 or VS2010 or you can use a virtual machine and run one inside the VM and one outside (or whatever).

We realize that this is an unfortunate situation but once everything gets to its final release (VS2010, .NET 4, and ASP.NET MVC 2) they will all be compatible with each other and can be installed on the same computer.
Requesting Gravatar... Rob Conery Dec 17, 2009 11:00 AM
# re: ASP.NET MVC 2 RC Released
"slated for some time in March"

Now I have a big reason to go to MIX :). Big hugs for you and the gang...
Requesting Gravatar... Rickj1 Dec 17, 2009 11:01 AM
# re: ASP.NET MVC 2 RC Released
I finished raising kids I know what your goin thruogh TRY SOY MILK
believe me happy baby
Requesting Gravatar... BuzzBox Dec 17, 2009 11:07 AM
# re: ASP.NET MVC 2 RC Released
@Eilon Lipton
What is, please, a version number of the RC DLL?
Also, as far as I know, I can still develop an application in VS10Beta2 and manually reference the new RC DLL? Or it will not compile within .NET 4 at all?

If I already have VS2010Beta 2 installed, I have to remove it to install MVC2 RC?
Requesting Gravatar... Drazen Dotlic Dec 17, 2009 11:51 AM
# re: ASP.NET MVC 2 RC Released
The other change related to validation is that the ValidationSummary now supports overloads where only model-level errors are displayed.


Excellent! I ran into this issue the other day and was wandering how to solve it.

Is there a way today with ASP.NET MVC 1.0 to get this kind of behavior?
Requesting Gravatar... Richard Kimber Dec 17, 2009 12:34 PM
# re: ASP.NET MVC 2 RC Released
This is really good news, I'm just gutted that I can't feel the benefits on VS2010. I'm now using 2010 exclusively for new projects.
Requesting Gravatar... Khalid Abuhakmeh Dec 17, 2009 12:41 PM
# re: ASP.NET MVC 2 RC Released
I agree with Richard Kimber. I can't help but feel like Microsoft is forgetting about the people getting their VS2010 groove on. I know you guys are busy, but please please please get us an update for VS2010 or help us understand how we can update our current VS2010 projects to use the new goodness.
Requesting Gravatar... Jason Alexander Dec 17, 2009 2:19 PM
# re: ASP.NET MVC 2 RC Released
Awesome! Nice work to you and team... can't wait to hack on it!
Requesting Gravatar... Ec Dec 17, 2009 5:19 PM
# re: ASP.NET MVC 2 RC Released
If there is source, then we could compile it for .NET4?:)
Requesting Gravatar... Eddy Recio Dec 17, 2009 5:44 PM
# re: ASP.NET MVC 2 RC Released
@Haacked and @Eilon,

Please keep up the good work! And whatever you do, DO NOT let all the silly questions about having the team support every possible VS Beta in lieu of shipping bits or diverge from your current release process. I really dont understand why you guys receive the same question time and time again.

Again, keep up the great work. Some of us understand :)

Eddy
Requesting Gravatar... Atilla Yadik Dec 17, 2009 11:27 PM
# re: ASP.NET MVC 2 RC Released
What a cute baby! Very nice picture. I was lol as soon as I saw.
Thanks!
Requesting Gravatar... Dmitry Fedorov Dec 18, 2009 1:18 AM
# re: ASP.NET MVC 2 RC Released
Cool to hear this news! Thanks!
Requesting Gravatar... Richard Kimber Dec 18, 2009 4:28 AM
# re: ASP.NET MVC 2 RC Released
The Gu has confirmed that the RC of VS2010 will get an MVC2 refresh. Keep up the good work, VS2010 and MVC2 is the most (coding) fun I've had in years.
Requesting Gravatar... Mike Paterson Dec 18, 2009 7:56 AM
# re: ASP.NET MVC 2 RC Released
I think a "poo explosion" is technically called a #3.

http://www.youtube.com/watch?v=iK0SobQovME

If you don't want to click on the link then google "poo explosion #3 commercial"
Requesting Gravatar... Soe Tun Dec 18, 2009 12:59 PM
# re: ASP.NET MVC 2 RC Released
@WayneBrantley

No it is not broken. At first, that's what I thought also.


When I look at the RC assembly using the .NET Reflector tool, the JavaScript metadata generation code is totally different from the web browser's "View Source".
The web application was somehow using the "cached" version of the MVC 2.0 **Beta** assembly.


Here is how to fix it.

==== 1 ====
Shutdown IIS Windows Service.
Close all running Visual Studio instances.

==== 2 ====
Clean the ASP.NET Temporary folder by deleting all your MVC WebApp folders.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

==== 3 ====
Delete the "bin" folder content in your MVC Web App from Windows Explorer.

==== 4 ====
Restart IIS and Visual Studio.
Rebuild the MVC Web App.

==== 5 ====
Make sure you are using the *NEWEST* MicrosoftMvcJQueryValidation.js file from the {MVC2-RC Source Code}\src\MvcFutures\ folder.

==== 6 ====
Remove this code because "ClientValidationFunction" property does not exist anymore.

<% ViewContext.FormContext.ClientValidationFunction = "EnableClientValidation"; %>



Hope it helps,
Soe
Requesting Gravatar... Soe Tun Dec 18, 2009 1:19 PM
# re: ASP.NET MVC 2 RC Released
What is now broken is the JSON metadata generated is treating <input type="checkbox" /> as required because the *Database Column* is a not-nullable [bit] column.

So, for all CheckBox input controls with a not-nullable Boolean property, we cannot submit the FORM unless we check the CheckBox.
Requesting Gravatar... Steve Dec 19, 2009 11:14 AM
# re: ASP.NET MVC 2 RC Released
Couldn't get multi-project area to work even with MVC Futures. Any sample/ideas please?
Requesting Gravatar... John C Dec 19, 2009 11:18 AM
# re: ASP.NET MVC 2 RC Released
@Soe Tun: Confirmed - I can duplicate this too...

John
Requesting Gravatar... Chad Moran Dec 19, 2009 12:08 PM
# re: ASP.NET MVC 2 RC Released
Great job Phil and Co, thanks a lot.
Requesting Gravatar... haacked Dec 19, 2009 11:13 PM
# re: ASP.NET MVC 2 RC Released
Hi All,

I posted a follow-up post that addresses Visual Studio 2010 support for ASP.NET MVC 2.
Requesting Gravatar... Simon W Dec 21, 2009 9:41 PM
# re: ASP.NET MVC 2 RC Released
Looks like I need to include MicrosoftAjax.js now for MicrosoftMvcJQueryValidation.js even though it only requires one tiny tiny piece.

Tried to report on connect but i always get really confused and lost so mentioning it here.

See also
http://stackoverflow.com/questions/1934803
Requesting Gravatar... Galilyou Dec 23, 2009 5:06 AM
# re: ASP.NET MVC 2 RC Released
Awesome! Nice work Phill. Feels like you will catch up with vs10 deadline after all, good job.
Requesting Gravatar... Deep Dec 28, 2009 1:43 AM
# re: ASP.NET MVC 2 RC Released
Dear Phill,

We just started [one month back] one new project using MVC 2 RC [using VS2008 SP1], but are facing lot of problems in doing the basic stuff which earlier was pieces of cake. Some of the issues we are facing:

Handling Session [though we are doing but not sure the best way]
Validation of controls while Updating records [its fine while insert]
Validation [in Insert] for Optional Integer data type
Multilingual [we were quite happy with simple resource files, but now not sure how to do]

There are many sample projects on MVC 1 are available for learning, but nothing that we saw is for MVC 2. Will be great if you give some pointers to the one doing all basic stuff in MVC 2.

Thanx & Regards,
Deep
Requesting Gravatar... Deep Jan 03, 2010 10:11 PM
# re: ASP.NET MVC 2 RC Released
Dear Phill,

I know the holidays are going on :-) but just wanted to inform that we have settled most of the issues, except for the "Validation of controls while Updating records [its fine while insert]"

Regards,
Deep
Requesting Gravatar... Yasir Atabani Jan 03, 2010 11:39 PM
# re: ASP.NET MVC 2 RC Released
Well done, I hope now I can convince my client to start using MVC. Although the learning curve for the team will be an issue.

Baby don't RC at me, I got the MVC for you
Requesting Gravatar... unicaja Jan 09, 2010 8:44 AM
# re: ASP.NET MVC 2 RC Released
good job, Thanks;)
Requesting Gravatar... Ales Golli Jan 10, 2010 1:13 PM
# re: ASP.NET MVC 2 RC Released
Mark, Steve,

Does VS show the "Add Area..." option if you create a new MVC project? Is the "Add Area..." option missing only in your old projects?

...then maybe you didn't upgrade the old projects properly.

You have to "Open the project file (the file with the .csproj or .vbproj file extension) and locate the ProjectTypeGuid element. In the value of that element, replace the GUID {603c0e0b-db56-11dc-be95-000d561079b0} with {F85E285D-A4E0-4152-9332-AB1D724D3325}." (RTF-release-notes) :-)

What do you have to say?

(will show your gravatar)
Please add 4 and 5 and type the answer here: