ASP.NET MVC 2 Beta Released

0 comments suggest edit

This is the first in a series on ASP.NET MVC 2 Beta

  1. ASP.NET MVC 2 Beta Released (Release Announcement)
  2. Html.RenderAction and Html.Action
  3. ASP.NET MVC 2 Custom Validation

Today at PDC09 (the keynote was streaming live), Bob Muglia announced the release of ASP.NET MVC 2 Beta. Feel free to download it right away! While you do that I want to present this public service message.

fptopsecret

The Beta release includes tooling for Visual Studio 2008 SP1. We did not ship updated tooling for Visual Studio 2010 because ASP.NET MVC 2 is now included as a part of VS10, which is on its own schedule.

Unfortunately, because Visual Studio 2010 Beta 2 and ASP.NET MVC 2 Beta share components which are currently not in sync, running ASP.NET MVC 2 Beta on VS10 Beta 2 is not supported.

Here are some highlights of what’s new in ASP.NET MVC 2.

  • RenderAction (and Action)
  • AsyncController
  • Expression Based Helpers (TextBoxFor, TextAreaFor, etc.)
  • Client Validation Improvements (validation summary)
  • Add Area Dialog
  • Empty Project Template
  • And More!

Go Live

ASP.NET MVC 2 Beta also includes an explicit go-live clause within the EULA. You should make sure to read it has an interesting clause which references the operation of nuclear facilities, aircraft navigation, etc. ;)

More Details Please!

You can find more details about this release in the release notes. Also be on the look out for one of ScottGu’s trademark blog posts covering what’s new

I’ve started working on a series of blog posts where I will cover features of ASP.NET MVC 2 in more detail. I’ll start publishing these posts one at a time soon.

Next Stop: RC

Our next release is going to be the release candidate hopefully before the year’s end. The work from now to RC will consist almost solely of bug fixes with a few minor feature improvements and changes.

Please do play with the Beta. If you run into an issue that’s serious enough, there’s still time to consider changes for RC. Otherwise it will have to wait for ASP.NET MVC 3 which I’m just starting to think about.

I’m thinking, “man, I can’t believe I’m already thinking about version 3”!”

Tags: aspnetmvc, asp.net

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

59 responses

  1. Avatar for Jeff Ammons
    Jeff Ammons November 16th, 2009

    Oh well. Guess I'll have to go back to running my nuculer facilities with Ruby On Rails. Websites and stuff I'll switch to MVC2 however.
    ;-)
    jeffa

  2. Avatar for Ryan Smith
    Ryan Smith November 17th, 2009

    Aack! Just made the switch on my MVC 2 project to VS2010 now I'll have to jump from MVC 2 Preview 2 to MVC 2 RC1 right?

  3. Avatar for Alun Harford
    Alun Harford November 17th, 2009

    Eugh!
    "To address these scenarios, the TempDataDictionary class was changed so that all the keys survive indefinitely until the key is read from the TempDataDictionary object. The Keep method was added to TempDataDictionary to let you indicate that the value should not be removed after reading. The RedirectToActionResult is an example where the Keep method is called in order to retain all the keys for the next request."
    "Adding a debugger watch that shows a value from TempData will mark it for deletion. The side effect was introduced as part of the changes to TempDataDictionary."
    That's seriously broken. Now you can forget to write out the contents of something in TempData ('you no longer have permission to delete that') and it'll get written out on some random page when you next check for that key. Unless you're debugging.
    We're sticking with Preview 2 here.

  4. Avatar for Attila
    Attila November 17th, 2009

    When will you release the source for this beta on CodePlex?
    Thanks,
    Attila

  5. Avatar for Michael
    Michael November 17th, 2009

    When can we look forward to it being supported in VS 2010?

  6. Avatar for lynn
    lynn November 17th, 2009

    Phil, was the team able to improve output caching scenarios with RenderAction? I believe right now you need to call an intermediate partial view to get the correct caching.

  7. Avatar for LaptopHeaven
    LaptopHeaven November 17th, 2009

    Can this be installed side-by-side with MVC 1?

  8. Avatar for Unknown
    Unknown November 17th, 2009

    When will a version for VS 2010 be released?

  9. Avatar for Scott Wade
    Scott Wade November 17th, 2009

    Wow...this is a total bummer (from the Release Notes): "Note Because Visual Studio 2008 and Visual Studio 2010 Beta 2 share a component of ASP.NET MVC, installing ASP.NET MVC 2 Beta on a computer where Visual Studio 2010 Beta 2 is also installed is not supported."
    Sticking with MVC 2.0 Preview 2 here as well then!

  10. Avatar for Richard Kimber
    Richard Kimber November 17th, 2009

    Really good news, but I'm using VS2010 now so I guess I'll have to wait for the next release of VS.
    Rich

  11. Avatar for Haacked
    Haacked November 17th, 2009

    @lynn We basically disable outputcache on an action method called via a RenderAction call which is better behavior than the previous where the whole page would get called.
    @LaptopHeaven Yes, it can be installed side-by-side.

  12. Avatar for Yitzhak
    Yitzhak November 17th, 2009

    What about corresponding ASP.NET MVC Futures?

  13. Avatar for Steve
    Steve November 17th, 2009

    Any command line domain, controller, view, test generation on the horizon ? (aka. grails)
    This speeds up development, rather than right click, create view (replace table with mvccontrib grid), then right click create controller, select domain objects, ad nausum.
    I see new glitter (good glitter) being added, would like to see it more forward toward 'practical' :)
    Happy to see the async-controllers (will make for good publishing to nservicebus!).
    So - any chance we'll begin to see some scaffolding/domain focused capability in the near future from the team ?
    Thanks for the updates - good stuff

  14. Avatar for Haacked
    Haacked November 17th, 2009

    @Yitzhak we're working on it.
    @Steve those areas are definitely something I want to look at for possibilities for ASP.NET MVC 3.

  15. Avatar for Piers
    Piers November 17th, 2009

    Once again you're keeping us on our toes. I look forward to tetsing out the AsyncController!

  16. Avatar for anton
    anton November 17th, 2009

    Do we have to wait until the next release of VS2010 before it can support MVC beta2?
    So VS2010 RC1 will support ASP.NET MVC RC1? At some point you will need to get the versions aligned.

  17. Avatar for farrio
    farrio November 17th, 2009

    Very glad to see BETA and the coming RC. When could it be released? Within the VS10 release?
    And very disappointed not support VS10 Beta... :(
    Is there any way we can walk around and install it into VS10 Beta even though manually?

  18. Avatar for Vikingo
    Vikingo November 17th, 2009

    Hi!
    What about Strongly Typed RedirectToAction and FluentHtml like mvccontrib?
    Thanks

  19. Avatar for Shiju Varghese
    Shiju Varghese November 17th, 2009

    Congrats Phil. Great news.

  20. Avatar for Kim Cu
    Kim Cu November 17th, 2009

    Hi Phil,
    Great News.
    Can you give some code about new features in this build?
    Thanks so much.

  21. Avatar for asper
    asper November 17th, 2009

    is it seamless to upgrade from mvc 1.0 to 2.0 for existing apps?

  22. Avatar for Richard Kimber
    Richard Kimber November 17th, 2009

    Will MVC 2 Preview apps work with MVC 2 Beta?

  23. Avatar for san
    san November 17th, 2009

    Can this be installed on windowsxp?

  24. Avatar for Mahesh Velaga
    Mahesh Velaga November 17th, 2009

    Hi Phil,
    This is not exactly related to this post, I just wanted to mention that, it would be good if every post also has the date time tag with it .. so that we can know when a particular post is posted.
    I was going through all the stuff in your blog and thats what I felt.
    Thanks

  25. Avatar for Edoardo
    Edoardo November 17th, 2009

    Phil,
    it is unclear whether ASP.NET MVC Beta 2 will be ever supported in VS2010 Beta 2 or not.
    Can you answer this question?
    Thanks

  26. Avatar for Mahesh Velaga
    Mahesh Velaga November 17th, 2009

    Just that they are not showing up on the preview/overview posts, but showing upon when you click on the post

  27. Avatar for alberto
    alberto November 17th, 2009

    Phil,
    Do you plan to add support for hyphenated controllers and actions? They are very important for SEO. Having that integrated into the framework (routing, links to actions, etc) would really easy things on us.

  28. Avatar for Kieron Lanning
    Kieron Lanning November 17th, 2009

    Phil, I do think it's unjust that the early adopter, that do so much for the community by trying beta/ ctp software, have once again been left out in the cold. I'm of course referring to the lack of support for VS2010 - for every comment left on your blog about the the lack of support, you must assume that there are hundreds/ thousands more who haven't replied that have the same issues.
    Is there nothing us VS2010'ers can do to get the beta playing nicely?? ...even an unofficial nudge in the right direction...

  29. Avatar for Dody Gunawinata
    Dody Gunawinata November 17th, 2009

    Bummer. I have moved exclusively to use Visual Studio 2010 Beta 2. I'll stick with Preview 2 until the current Beta 2 code is available.

  30. Avatar for Bikal Gurung
    Bikal Gurung November 17th, 2009

    Is there any difference between the MVC 2 preview 2 release? functionality wise ?

  31. Avatar for Bikal Gurung
    Bikal Gurung November 17th, 2009

    Just a note. Realised you need to uninstall the MVC 2 prior releases to install this beta.

  32. Avatar for Hm
    Hm November 17th, 2009

    Please provide a release for VS 2010 Beta 2!

  33. Avatar for Haacked
    Haacked November 17th, 2009

    To all who asked about VS10 Beta 2 and ASP.NET MVC 2 Beta, I know it's frustrating for those on VS10 Beta 2 who want to try out the ASP.NET MVC 2 Beta, and I'm sorry for that.
    The tricky part in all this is that we're trying to hit two different ship trains. Unfortunately, I don't have any control over the VS10 ship schedule, so I can't force them to ship when we ship.
    Since ASP.NET MVC 2 for VS10 is actually part of VS10, we really didn't want to get in the business of trying to ship parts of VS10 outside of the VS10 schedule. I'm not sure the VS10 team would be happy about that given it could interfere with evaluations of VS10 if we bork the installation.
    The other option is to simply not ship previews of ASP.NET MVC 2 and wait for each VS10 release for people to get a taste. Obviously that's not the answer, so we didn't do that.
    If you want to run ASP.NET MVC 2 on VS2008 side by side with VS2010, there is an unsupported at your own risk don't cry to us solution.
    In Add/Remove programs uninstall the ASP.NET MVC 2 Tools for Visual Studio 2008 and then uninstall the ASP.NET MVC 2 runtime. It's the option that says simply "Microsoft ASP.NET MVC 2".
    After that, install ASP.NET MVC 2 Beta. This will put the ASP.NET MVC 2 tools in VS10 in a state where they are not in sync with the runtime. We haven't tested this configuration a whole lot so it could also interfere with your ability to uninstall VS10 Beta 2, though I'm not sure if it will or not.
    Again, we do appreciate you trying out pre-release software as your feedback is very helpful. I hope you are willing to accomodate the pains that often go hand in hand with pre-release software.
    The situation will be fully resolved by RTM.

  34. Avatar for Green Williams
    Green Williams November 17th, 2009

    Wake me up; on this MVC thing when version 3 comes out!

  35. Avatar for gerry lowry
    gerry lowry November 17th, 2009

    "running ASP.NET MVC 2 Beta on VS10 Beta 2 is not supported".
    @ Phil ... I think you need to post disclaimer above also at:
    http://forums.asp.net/t/1494009.aspx
    I downloaded MVC 2 Beta specifically to use with VS10 Beta 2.
    Thnx / Gerry

  36. Avatar for Yitzhak
    Yitzhak November 17th, 2009

    We currently have a VS2008 solution with multi-project areas. It was developed using the MVC 2 Preview 2. We are planning to migrate that solution to the recently released MVC 2 Beta.
    ASP.NET MVC 2 Beta Release Notes document states the following:
    •The build task for multi-project areas has been removed and placed in the ASP.NET MVC Futures project.
    It sounds like that the support for multi-project areas was dropped in favor of single project with multiple areas organized as sub-folders on the file system.
    The question is what is the recommended migration path to the MVC 2 Beta in our scenario?
    Regards,
    Yitzhak

  37. Avatar for AndyM
    AndyM November 18th, 2009

    First, I want to share my appreciation for the great work you guys are doing on ASP.NET MVC. I'm having problems with the Multi Area - Multi project change as well. I downloaded the Beta2 futures module, but am still getting build errors when the "CreateAreaManifest" build task is reached in web.config (Can not load Microsoft.Web.Mvc.Build). Any tips on how to get this working?

  38. Avatar for Soe Tun
    Soe Tun November 18th, 2009

    Client-side validation is "broken". In Preview 2, javascript function EnableClientValidation() is defined in MicrosoftMvcJQueryValidation.js file.

    However, in MVC2 Beta version, MicrosoftMvcAjax.js file does not define the function.
    Because of it, I'm getting JavaScript error dialog window and had to add it on my own.

  39. Avatar for Chris
    Chris November 18th, 2009


    @Soe, It seems the MSI install doesn't include MicrosoftMvcJQueryValidation.js, I had to grab it from the source code download.
    @Phil, In regards to the "Areas", the right click "Add Area" command is super awesome - only problem I had was that I immediately ran into the "The controller name 'Home' is ambiguous between the following types" when I made the second home controller.
    I knew the solution (add the namespace parameter to the route configs in case anybody else is wondering), but I'm just wondering if there is any plan to have the automatically generated "RegisterRoutes" templates include the namespace parameter by default? This might just make it a more usable feature for people just getting started.

  40. Avatar for Trevor de Koekkoek
    Trevor de Koekkoek November 18th, 2009

    My site uses $.getJSON() which returns a json array. There is no equivalent $post version of this that I'm aware of. So as a result my site couldn't work without setting JsonRequestBehavior.AllowGet which means my code is still vulnerable. Are there any suggestions as to how to handle this?

  41. Avatar for Soe Tun
    Soe Tun November 18th, 2009

    @Chris I got the MicrosoftMvcJQueryValidation.js from the source. The generated client-side validation function name used to be EnableClientValidation(validationContext, userState).
    But, now it defaults to "Sys.Mvc.FormValidation.enableClientValidation" now as you can see in the System.Web.Mvc.FormContext class.

    Looks like we have to manually set the "ClientValidationFuntion" name inside the Html.BeginForm() block like this.
    <% using(Html.BeginForm()) { %>
    <% this.ViewContext.FormContext.ClientValidationFunction = "EnableClientValidation"; %>
    ...
    <% } // using BeginForm() block ends %>

  42. Avatar for I have some custom ModelBinder
    I have some custom ModelBinder November 19th, 2009

    I have a project with some custom modelbinders. It was really cool to add support for instance dictionary binding:
    [ModelBinder(typeof(DictionaryBinder<Guid,int>))]Dictionary<Guid,int> model
    However, it seems that there is a new weird kind of interface for the valueprovider:
    bool ContainsPrefix(System.Web.Mvc.ControllerContext, string)
    ValueProviderResult GetValue(System.Web.Mvc.ControllerContext, string)
    Why the tight coupling to ControllerContext? Why does the ValueProvider need to know about the controllercontext?
    Best Regards from M

  43. Avatar for Felipe Lima
    Felipe Lima November 19th, 2009

    I'm also confused as to what is the way go regarding Area support. I'm having the same problem as @Yitzhak, It would be good to know if the multi-project support for area registration is/will be dropped.
    BTW, the Add area dialog is great.
    Thanks Phil and all the MVC team for the great work! Really appreciated.
    Felipe

  44. Avatar for Yitzhak
    Yitzhak November 19th, 2009

    Hi Phil,
    I asked the same question, regarding the multi-project Areas support, on the ASP.NET MVC forum:
    forums.asp.net/p/1494640/3520813.aspx#3520813
    Up to this moment there is not a single reply on it.
    This question is very important to answer for the entire community of supporters of the Microsoft ASP.NET MVC technology stack. Felipe Lima and I, like many others, are worried that there is no clear guidance from the ASP.NET MVC team regarding the multi-project Areas support in the ASP.NET MVC 2 version. This is a strategic infrastructure level question. You, being in capacity of the captain of the product, i.e. Senior Program Manager on the MVC team, would be the best person to provide the guidance and answer the question.
    Regards,
    Yitzhak

  45. Avatar for Kiran
    Kiran November 20th, 2009

    Is there any guidance in using AdditionalValues dictionary in ModelMetadata class? How this dictionary gets populated?

  46. Avatar for Chris Pietschmann
    Chris Pietschmann November 21st, 2009

    I think not "officially" supporting ASP.NET MVC 2 Beta with VS'2010 isn't very smart. A lot of us are working with ASP.NET MVC 2 with VS'2010 and you are essentially abandoning us. Especially when you could just ship a new version of the "ASP.NET MVC 2 Visual Studio 2010 Tools" with the ASP.NET MVC 2 Beta just as you are shipping "ASP.NET MVC 2 Visual Studio 2008 Tools". C'mon guys this just looks lazy from my perspective, especially since both VS'2010 and ASP.NET MVC 2 Beta have Go Live licenses and are both supported separately.

  47. Avatar for Kieron Lanning
    Kieron Lanning November 22nd, 2009

    @chris - Completely agree, I'm not going to chuck my toys in the corner and cry too much, but as you say, I do feel a little abandoned, especially as it should be just a tooling problems - the core assembly is probably the same.
    Has anyone tried simply referencing the beta from with VS2010?

  48. Avatar for Haacked
    Haacked November 22nd, 2009

    @Kieron yes, you can simply reference the beta from VS10. The MVC Tooling experience will be out of sync with the runtime, but most of it would work just fine.

  49. Avatar for Kieron Lanning
    Kieron Lanning November 22nd, 2009

    @Phil - Hey, that's good news. We can always build everything else manually - nowt wrong with a little manual labour now and again.
    Thanks!
    Kieron

  50. Avatar for Deep
    Deep November 23rd, 2009

    Dear Phil,
    Need your advice. We are starting a new project on .net and like to use the MVC. Shall we use the MVC 1 or can go for MVC 2 Beta and later upgrade to final release.
    Also shall we use VS2008 or VS2010 Beta 2?
    Thanx for your time.
    Regards,
    Deep

  51. Avatar for Lance Fisher
    Lance Fisher November 24th, 2009

    Now I'm so torn whether to use VS 2010 w/MVC 2 Preview 2, VS 2008 2/MVC 2 Beta, or something unsupported and dangerous...
    Thanks for all your hard work on this, but it is frustrating since I like shiny new things and they don't work together.

  52. Avatar for Haacked
    Haacked November 24th, 2009

    You can use VS10 with ASP.NET MVC 2 Beta if you simply reference the beta assembly as just another bin dependency. That's supported just fine. However, the tooling for VS10 will be out of sync, as it thinks you have the Preview 2 runtime.
    I should have been more clear, running the ASP.NET MVC 2 Beta installer is not supported on a machine with VS2010. However, you can grab a copy of the beta MVC 2 dll and reference it in a VS10 project, but the experience won't be as nice.

  53. Avatar for Haacked
    Haacked November 24th, 2009

    @Deep That's a hard question to answer without knowing more about your environment. Are you able to respond to a changing framework? Or is stability a requirement? We may still make a few changes to ASP.NET MVC 2, but we won't be changing ASP.NET MVC 1.0.

  54. Avatar for kmehta
    kmehta November 24th, 2009

    Just upgraded from Beta2P2 to Beta2. Everything worked great (almost). I'm referencing the futures dll (Microsoft.Web.Mvc) as well as System.Web.Mvc.Html from my web config. I unfortunately need/want both namespaces for some things I'm doing.
    Unfortunately some of my methods (ValidationMessageFor, TextBoxFor ...) are throwing an "Ambiguous Invocation" error. After the Beta2 release, it appears that some extension methods are duplicated in the core and futures libraries.
    Phil, do you suggest a way around this, or is there a new version of the futures dll being released soon with these duplicates removed?
    Appreciate the help.

  55. Avatar for AlanM
    AlanM November 25th, 2009

    @Phil - regarding VS10b2 and MVCb2, when you say "the tooling for VS10 will be out of sync, as it thinks you have the Preview 2 runtime.", can you please elaborate on what tooling will be out of sync so we know what the pain points will be? I'm guessing/hopeful it will actually not be that significant to most mvc developers.

  56. Avatar for dpfresh
    dpfresh December 13th, 2009

    Phil, any word on a server install for the beta? Obviously this would be for a test server at this point but mvc 1 offered a command line server install option...
    Much thanks.

  57. Avatar for BuzzBox
    BuzzBox December 15th, 2009

    I'll sign up for the same questio for @Phil - regarding VS10b2 and MVCb2, when you say "the tooling for VS10 will be out of sync, as it thinks you have the Preview 2 runtime.", can you please elaborate on what tooling will be out of sync so we know what the pain points will be? I'm guessing/hopeful it will actually not be that significant to most mvc developers.

  58. Avatar for Hemant Sathe
    Hemant Sathe December 19th, 2009

    Hi,
    I had a working project where I was puling values from the Form using FormCollection and then using TryUpdateModel(itemToEdit, collection.ToValueProvider()). Since the upgrade, this call was failing giving error that "name" parameter cannot be null. I first thought it is error in my code. But there was none. I then downloaded source code and started debugging. I found that the DefaultModelBinder.BindModel method on Line 143 in System.Web.MVC, expects a ModelName. This value is set as the prefix provided by TryUpdateModel, which in my case was null. This is throwing the exception. However, if I change my code to receive the form values as the item type instead of collection, the code is working OK. Does this mean that using the value providers is reserved only for custom value providers with a specific value provided for ModelName?
    Thanks

  59. Avatar for OutOfTouch
    OutOfTouch January 15th, 2010

    When will ASP.Net MVC stop being a beta or RC and be released with a Version of Visual Studio? 2010?