ASP.NET MVC 3 Release Candidate 2

Almost exactly one month ago, we released the Release Candidate for ASP.NET MVC 3. And today we learn why we use the term “Candidate”.

As Scott writes, Visual Studio 2010 SP1 Beta was released just this week and as we were testing it we found a few incompatibilities with it and the ASP.NET MVC 3 RC that we had just released.

newdotnetlogo_2That’s when we, in the parlance of the military, scrambled the jets to get another release candidate prepared.

You can install it directly using the Web Platform Installer (Web PI) download the installer yourself from from here.

Be sure to read the release notes for known issues and breaking changes in this release. I’m not saying I put an Easter egg in there or not, but you’ll have to read all the notes to find out.

In particular, there are two issues I want to call out.

Breaking Change Alert!

The first is a breaking change. Remember way back when I wrote about Dynamic Methods in ViewData? Near the end of that post I wrote an Addendum about the property name mismatch between ViewModel and View.

Well we finally resolved that mismatch. The new property name, both in the controller and in the view is ViewBag. This may break many of your existing ASP.NET MVC 3 pre-release applications.

NuGet Upgrade Alert

The other issue I want to call out is that if you already have NuGet installed, running the ASP.NET MVC 3 RC 2 installer will not upgrade it. Instead, you need to go to the Visual Studio Extension Manager dialog (via the Tools | Extensions menu option) and click on the Updates tab. You should see NuGet listed there (click on image for larger image):

extension-manager

The NuGet.exe command line tool for creating packages is available on CodePlex.

Overall, this release consists mostly of bug fixes along with some fit and finish work for ASP.NET MVC 3. We’ve updated the version of jQuery and jQuery Validation that we include in the project templates and now also include jQuery UI, a library that builds on top of jQuery to provide animation, advanced effects, as well as themeable widgets.

In terms of NuGet, this release contains a significant amount of work. I’ll try and follow up soon with more details on the NuGet release along with release notes.

What others have said

Requesting Gravatar... Still off for me Dec 10, 2010 3:04 AM
# re: ASP.NET MVC 3 Release Candidate 2
The download link still off for me :(
Requesting Gravatar... Marcus Wendt Dec 10, 2010 3:07 AM
# re: ASP.NET MVC 3 Release Candidate 2
Will the source code for the RC become available? I can only find beta sources at http://aspnet.codeplex.com/

Thanks!
Requesting Gravatar... Paul Dec 10, 2010 3:09 AM
# re: ASP.NET MVC 3 Release Candidate 2
ViewBag??? ... mmmmm
Requesting Gravatar... haacked Dec 10, 2010 3:09 AM
# re: ASP.NET MVC 3 Release Candidate 2
@Still off for me. I updated the link to point directly to the installer temporarily. The download page is still propagating. I apologize. I thought it had propagated but I was looking at the wrong one. :(

@Marcus yes, we'll try to get the source up soon.
Requesting Gravatar... Justin Burns Dec 10, 2010 3:10 AM
# re: ASP.NET MVC 3 Release Candidate 2
The release notes still refer to "NuPack". Where's the NuGet-y goodness? :)
Requesting Gravatar... Bob Dec 10, 2010 3:20 AM
# re: ASP.NET MVC 3 Release Candidate 2
Do I need to uninstall MVC 3 RC before installing MVC 3 RC 2?
Requesting Gravatar... sirmak Dec 10, 2010 3:55 AM
# re: ASP.NET MVC 3 Release Candidate 2
Did you solved the huge performance issue in this release (in mvc 3 rc1, speed was half of the mvc 2) ?
Requesting Gravatar... sirmak Dec 10, 2010 3:58 AM
# re: ASP.NET MVC 3 Release Candidate 2
Hi, here is a link about this issue: stackoverflow.com/...
Requesting Gravatar... Bats Ihor Dec 10, 2010 4:04 AM
# re: ASP.NET MVC 3 Release Candidate 2
Renaming ViewModel and View to the ViewBag it's very good news, but why did you choose this name? Why not ViewModel?

sorry for bad English I am form Ukraine...
Requesting Gravatar... Brian Vallelunga Dec 10, 2010 4:13 AM
# re: ASP.NET MVC 3 Release Candidate 2
Is there a way to install this with WPI?
Requesting Gravatar... Asbjørn Dec 10, 2010 4:34 AM
# re: ASP.NET MVC 3 Release Candidate 2
Just a note on installation. I had it fail on vs10-kb2465236-x86.exe for no apparent reason. The log file didn't say anything more than a serious error occured. However, once I opened the update by itself, it became apparent that it wanted to access the VS2010 installation disc (or in my case, ISO image). On it did so, it installed with no issues. And so did the rest of MVC3.
Requesting Gravatar... James Dec 10, 2010 4:54 AM
# re: ASP.NET MVC 3 Release Candidate 2
NuGet currently fails at the one thing it tries to solve. When the hell are all the packages going to be updated? Still no NH3.0/Fluent-NH3.0, it's still beta/rc on there.
Requesting Gravatar... rekna Dec 10, 2010 6:48 AM
# re: ASP.NET MVC 3 Release Candidate 2
I have a problem since MVC3 RC2...
The values that are posted to my controller method are
FormSearch=True&van=1%2f01%2f2010&soort=938&_search=false&nd=1292020754078&rows=-1&page=1&sidx=&sord=asc

My controller method accepts parameters (string van, int? soort, bool? FormSearch). van and FormSeach contain the expected values, but soort appears to be null...??? with RC1 this was working as expected.
Requesting Gravatar... Alexander Taran Dec 10, 2010 7:12 AM
# re: ASP.NET MVC 3 Release Candidate 2
is vs2010 sp1 beta required?
Requesting Gravatar... haacked Dec 10, 2010 7:55 AM
# re: ASP.NET MVC 3 Release Candidate 2
Hi All, You do not need to uninstall ASP.NET MVC 3 RC before installing RC 2. VS 2010 SP 1 Beta is not required for MVC 3 RC 2. You can install it on VS 2010 without SP1 Beta.

@James You'll have to talk to the NHibernate owners.
Requesting Gravatar... Hajan Dec 10, 2010 6:57 PM
# re: ASP.NET MVC 3 Release Candidate 2
Great job guys! I've read the ScottGu's blog today. You have included some cool stuff in the RC 2. The installation and everything else passed good for me. However, I just saw in the asp.net forums a user have reported problem with the Nullable parameters sent to the Controller's method. See the forum post here: http://forums.asp.net/t/1632006.aspx
Requesting Gravatar... sirmak Dec 10, 2010 10:57 PM
# re: ASP.NET MVC 3 Release Candidate 2
Hi, I have benchmarked again and found that, there isn't any performance problem with mvc 3 aspx pages now, but a big performance hit exits with the razor templating (approximitaly twice).
Requesting Gravatar... Hem Talreja Dec 11, 2010 4:21 AM
# re: ASP.NET MVC 3 Release Candidate 2
In RC1 I was unable to get areas working with DI, is it possible to post a simple sample using mvc3, nhibernate or entity, unity + areas?

Thanks

-Hem
Requesting Gravatar... sirmak Dec 11, 2010 4:25 AM
# re: ASP.NET MVC 3 Release Candidate 2
Thanks to Marcind, he helped me to find out that there is no performence issue in asp.net mvc 3, it was my benchmarking issue as you can see here stackoverflow.com/...

Excellent job!
Requesting Gravatar... rekna Dec 12, 2010 12:42 AM
# re: ASP.NET MVC 3 Release Candidate 2
Concerning the bug I posted (ASP.NET forums (forums.asp.net/.../1632006.aspx)) with the nullable int parameter, this has been confirmed to be a bug introduced in RC2 and in the same post is mentioned a workaround that solves the problem for now
Requesting Gravatar... Felix Dec 12, 2010 3:37 AM
# re: ASP.NET MVC 3 Release Candidate 2
I wonder if there are plans to put source code on codeplex? Beta is obviously obsolete; and RC1 was skipped. What about RC2?
Requesting Gravatar... Mike Dec 12, 2010 10:48 AM
# re: ASP.NET MVC 3 Release Candidate 2
Installation failed with a nondescript error message:
Exe (d:\temp\ext6142\VS10-KB2465236-x86.exe) failed with 0x80070643 - Fatal error during installation.
.
PerformOperation on exe returned exit code 1603 (translates to HRESULT = 0x80070643)
Error 1603 is mapped to Custom Error:
OnFailureBehavior for this item is to Rollback.
Final Result: Installation failed with error code: (0x80070643), "Fatal error during installation.
" (Elapsed time: 0 00:00:16).
Requesting Gravatar... David Dec 12, 2010 1:10 PM
# re: ASP.NET MVC 3 Release Candidate 2
Hi,
As iam a leaner of Asp.net, this asp.net MVC 3 Release Candidate concept is new to me. What you have explained is very nice even then i need some more detailed explanation.Keep posting. Thanks for a nice tutorial.

godwinsblog.cdtech.in/...

Requesting Gravatar... Cassio R Eskelsen Dec 12, 2010 6:44 PM
# re: ASP.NET MVC 3 Release Candidate 2
Hi Phil!

I had installed the Async Framework as soon as it was announced at the PDC. When installing the Asp.Net MVC 3 RC 1 I had the problem of lack of compatibility with the Async Framework and uninstalled it, thus installing the RC 1. Now when you install RC 2, I get the following message:

"Blocking Issues:

This product is Incompatible with the Microsoft Visual Studio CTP Async. Please uninstall the component, then try to install this product again.
"

You know what I could do to force the installation?

Thanks!

Cassio
Requesting Gravatar... Slava Dec 12, 2010 7:55 PM
# re: ASP.NET MVC 3 Release Candidate 2
Very good news.
Requesting Gravatar... Stacey Dec 12, 2010 9:34 PM
# re: ASP.NET MVC 3 Release Candidate 2
I have to agree with an earlier post - why 'ViewBag' instead of just 'ViewModel'?
Requesting Gravatar... Upupto Dec 13, 2010 3:04 PM
# re: ASP.NET MVC 3 Release Candidate 2
why not use 'Page'
Requesting Gravatar... ashic Dec 13, 2010 5:41 PM
# re: ASP.NET MVC 3 Release Candidate 2
What's this fixation on the word "View"? ViewBag seems a bit weird...why not call it simply "Data" in both the controller and the view?
Requesting Gravatar... Adam Dec 13, 2010 8:06 PM
# re: ASP.NET MVC 3 Release Candidate 2
@philhaack: You're skirting the issue. Just make "ViewData" a dynamic dictionary. I'm sure it's painful, probably more for the MVC team than most of us, but it's the only way everybody will be happy. I've made some really big projects using MVC (ones I don't really want to have to change.) But everytime you release a new version of MVC, I have to make changes. dynamic ViewData. Just do it. You'll feel better afterwards.
Requesting Gravatar... hazzik Dec 14, 2010 12:46 AM
# re: ASP.NET MVC 3 Release Candidate 2
class dao { string SomeValue; }
class childDao : dao { }

<%ViewPage<childDao>%>

<%= Html.Editor("SomeValue") %> -- there ModelType is childDao
<%= Html.EditorFor(x=>x.SomaValue) %> -- there ModelType is dao
Requesting Gravatar... MJ Dec 14, 2010 2:24 AM
# re: ASP.NET MVC 3 Release Candidate 2
ViewBag? Come on... of course you can come up with a better property name than that.
Requesting Gravatar... lgm Dec 14, 2010 4:21 AM
# re: ASP.NET MVC 3 Release Candidate 2
I don't understand why but the quickfix with autoFormsAuthentication does not work anymore since the RC2 :(

I'm still redirected to /Account/Login which does not exists for me.
I thought it would be fixed for the RC2. did I miss something?
Requesting Gravatar... haacked Dec 14, 2010 5:38 AM
# re: ASP.NET MVC 3 Release Candidate 2
@Adam that would break all extension methods on the ViewDataDictionary for everyone.

@Igm Could you provide more details? I'm not able to reproduce this on a brand new MVC 3 project. Do you still have references to WebMatrix.Data and/or WebMatrix.WebData? Those references are no longer needed.
Requesting Gravatar... Gideon Israel Dec 14, 2010 11:15 PM
# re: ASP.NET MVC 3 Release Candidate 2
Hey! Im working on a slightly big project and part of it is a web app.

I decided to go with mvc and got the books I started playing with mvc2. I seriously LOVE razor, just the look of it, haven't downloaded MVC3 yet.

My question: Would it be safe to use mvc3 RC2 for my project? I dont want to use mvc2 then upgrade, but I will have to make a iterative release on Jan 1 for my project. Will the RTM come by then? Also, Im assuming going from RC2 to RTM won't really be a problem!?
Requesting Gravatar... Adam Dec 15, 2010 12:17 AM
# re: ASP.NET MVC 3 Release Candidate 2
@Phil:
Thanks for the reply. I didn't know there were extension methods for ViewDataDictionary (other than the LINQ ones.) What do these do?

(I'm still convinced you wont be fulfilled until ViewData is dynamic, despite the havock it will cause. But that is your call, and it isn't why I'm asking about the extension methods. I just wonder where they are and what they do so I can start using them.)
Requesting Gravatar... Haddy Dec 15, 2010 10:39 PM
# re: ASP.NET MVC 3 Release Candidate 2
I hear a lot of complaining... and very little appriciation. Thans Phil, and the rest of the Asp.net MVC team for making this happen and putting the time and resources forward to continue to expand the project. Asp.net MVC, I feel, is the best thing to happen to .NET for a while. I love it, and I don't think I'll ever go back to webforms for any of my own projects.

As far as the naming... no name is perfect, nor can they please everyone. Viewbag... eh, might be considered slander in some states lol... but anyways, good luck finding a name everyone agrees on.
Requesting Gravatar... richy r. Dec 16, 2010 4:02 AM
# re: ASP.NET MVC 3 Release Candidate 2
@Haddy
I agree with Adam, ViewData actually would be a perfect name. But you are right, MVC3 and inparticular Razor is amazing. Well done Haack!

@Adam
I don't think there are any inbuilt ViewData extension methods. There are plenty of examples on the internet where people have made custom extensions. Say if you had an extension method that creates a select list.

e.g.
Html.DropDownList("FooId", ViewData.BuildSelectList("Stuff"));

You cannot make dynamic extension methods. If you use strongly typed view-models, you'll never come across this. But you could always push the method into the view data (seperate the concern by putting this population in a different place.)

@Haacked
The big selling point for me about MVC (and I know this goes for alot developers) is that MVC is tidy. For that we have alot to be greatful to you for. Webforms seem overtop and cluttered with a number of features that do the same thing. Please keep MVC tidy.

I vote for onward and upward. I agree with Adam, it's not the only breaking change we've had the endure. I do also agree with Haddy, well done, you've put together some excellent work.
Requesting Gravatar... Gideon Israel Dec 16, 2010 3:35 PM
# re: ASP.NET MVC 3 Release Candidate 2
@Richy so true about the tidy-ness. Somewhere I read, doing a data driven app in web forms is a breeze but you might miss that in mvc.

NO I dont! The DataAnnotation, the automatic client side validate and the scaffolding make MVC so much faster and cleaner as opposed to forms!
Requesting Gravatar... Adam Dec 16, 2010 7:36 PM
# re: ASP.NET MVC 3 Release Candidate 2
@Haddy:
MVC3 is brilliant. I think rich has hit the nail on the head. I like MVC because it's clean. ViewBag seems to make it messy and it feels like it has been added with much reluctance.

@rich:
I do use strongly-type view models. I think though that using methods in a dynamic object is also messy, especially since extension methods are used everywhere now (not least with Ajax, Html and Url helpers.) But then dynamic typing doesn't really fit into that way of doing things.
Requesting Gravatar... ashic Dec 16, 2010 9:48 PM
# re: ASP.NET MVC 3 Release Candidate 2
Erm...why aren't we calling it simply "Data" in both the controller and the view again? What's the "View" prefix doing? If it's not a viewresult and we wished to pass dynamic data to a different type of "ActionResult", would we still call it "ViewBag"? Simply calling it "Data" would result in:
1. Less typing.
2. Be applicable to any ActionResult.
3. Convey all intent necessary.
4. Won't sound as silly as Bag or Purse...

Erm...why aren't we calling it simply "Data" in both the controller and the view again?
Requesting Gravatar... Vlad Dec 17, 2010 1:43 AM
# re: ASP.NET MVC 3 Release Candidate 2
Html.EditorFor doesn't consider RequiredAttribute inherited classes for client side validation

I want to localize the error message for the Required attribute and store it in the database. For this purpose I created a custom class LocalizedDisplayNameAttribute the inherits DisplayNameAttribute and overrides the DisplayName property. Everything is ok server side where the Model.IsValid returns what it should and the Html.ValidationSummary correctly displays the localized text from the class LocalizedDisplayNameAttribute, however the method Html.EditorFor doesn't generate the needed items for client side validation.

This seems to be a big bug!

I opened a bug in Codeplex: http://aspnet.codeplex.com/workitem/7782
Requesting Gravatar... Martin Dec 17, 2010 10:16 AM
# re: ASP.NET MVC 3 Release Candidate 2
Is there an Mvc Futures available for the MVC 3 RC 2 ?
Requesting Gravatar... People Skills Dec 17, 2010 10:47 PM
# re: ASP.NET MVC 3 Release Candidate 2
This is good news. Visual studio is one of my favorite applications. Last post: how to be charismatic
Requesting Gravatar... Cincherg Dec 18, 2010 1:26 PM
# re: ASP.NET MVC 3 Release Candidate 2
Wonderful web-site, in which did you observed this facts in this article? I am glad I observed it. i will be checking out back soon to check what other articles or blog posts you may have.
Requesting Gravatar... Bharat Patel Dec 19, 2010 10:44 PM
# re: ASP.NET MVC 3 Release Candidate 2 (TryUpdateModel issue)
I migrated my test app from MVC2 to MVC3 and seeing some wierd issues with the TryUpdateModel. It was working fine but after upgrading it is not updating the collection of objects.

Following is the sequence:

TryUpdateModel for Order and it successfully updates the model and return false.
2nd TryUpdateModel for the collection of order items and it works fine and returns false.
3rd TryUpdateModel for collection of payment items and it does not update the model.

What is the issue here? It used to work fine in MVC2. Do I have to reconsider this using different approach in MVC3?

Here is Question on StackOverflow: stackoverflow.com/...

THANKS
Requesting Gravatar... Adam Dec 20, 2010 10:24 PM
# re: ASP.NET MVC 3 Release Candidate 2
@ashic
ViewPurses go inside ViewBags.

Can you imagine the controller having to find it for every request?

It would have to get out the ViewMakeup, ViewLipstick, ViewHairBrush and it would just p*ss aload of people off.
Requesting Gravatar... Zain Shaikh Dec 22, 2010 3:24 AM
# re: ASP.NET MVC 3 Release Candidate 2
Excellent!!!
Requesting Gravatar... Igorbek Dec 25, 2010 4:22 PM
# Nested inline templates
At the moment, Razor does not allow nesting inline templates. For, ex:

@list.RenderAll(@

Sites: @item.Sites.RenderList(@< a href="@item">@item, separator: ", "))

Exception: Razor does not allow nested inline templates.

Of course, it is not possible, it makes an 'item' identifier conflict.

Are you planning to allow nested inline templates in the next versions of Razor?
May be possible to provide syntax like this:

@<tag>...</tag> - one typeless parameter named 'item', by default
@[param]<tag>...</tag> - one typeless parameter named 'param' (no conflict with item)
@[Type param]<tag>...</tag> - one typed parameter named 'param'
@[Type param, ...]<tag>...</tag> - multiple parameters

Thanks for a time!

Requesting Gravatar... FS Jan 04, 2011 3:15 AM
# re: ASP.NET MVC 3 Release Candidate 2
Please change the ViewBag name! This is a horrible name!
Requesting Gravatar... Dave Jan 05, 2011 11:30 PM
# re: ASP.NET MVC 3 Release Candidate 2
ViewBag is in fact a very good name for it. Collections can be stored in terms of sets, bags or lists. Each collection type has it's own usage.

Bag: Unordered list of entities, duplicates allowed.
Set: Unordered list of unique entities, duplicates not allowed
List: Ordered collection of entities, duplicates allowed


Requesting Gravatar... John Jan 28, 2011 3:05 AM
# re: ASP.NET MVC 3 Release Candidate 2
Is it possible to disable global action filters for a single action?

What do you have to say?

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