ASP.NET MVC 3 and NuGet 1.0 Released (Including Source Code!)

asp.net, asp.net mvc, code, open source, nuget 0 comments suggest edit

The changing of the year is a time of celebration as people reflect thoughtfully on the past year and grow excited with anticipation for what’s to come in the year ahead.

Today, there’s one less thing to anticipate as we announce the final release of ASP.NET MVC 3 and NuGet 1.0!

double-rainbow \ Oh yeah, this never gets old.

Install it via Web Platform Installer or download the installer directly to run it yourself.

Here are a few helpful resources for learning more about this release:

Those links will provide more details about what’s new in ASP.NET MVC 3, but I’ll give a quick bullet list of some of the deliciousness you have to look forward to. Again, visit the links above for full details.

  • Razor view engine which provides a very streamlined syntax for writing clean and concise views.
  • Improved support for Dependency Injection
  • Global Action Filters
  • jQuery based Unobtrusive Ajax and Client Validation.
  • ViewBag property for dynamic access to ViewData.
  • Support for view engine selection in the New Project and Add View dialog
  • And much more!

For those of you wishing to upgrade an ASP.NET MVC 2 application to ASP.NET MVC 3, check out Marcin Dobosz’s post about our ASP.NET MVC 3 Projct upgrader tool. The tool itself can be found on our CodePlex website.

NuGet 1.0 RTM

Also included in this release is the 1.0 release of NuGet. I’ll let you in on a little secret though, if you upgraded NuGet via the Visual Studio Extension Gallery, then you’ve been running the 1.0 release for a little while now.

If you already have an older version of NuGet installed, the ASP.NET MVC 3 installer cannot upgrade it. Instead launch the VS Extension manager (within Visual Studio go to the Tools menu and select Extension Manager) and click on the Updates tab.

Just recently we announced the Beta release of our NuGet Gallery. Opening the door to the gallery will make it very easy to publish packages, so what are you waiting for!?

At this point I’m obligated to point out that everything about NuGet is open source and we’re always looking for contributors. If you’re interested in contributing, but are finding impediments to it, let us know what we can improve to make it easier to get involved. Here’s the full list of OSS projects that make up the NuGet client and the server piece:

Show Me The Open Source Code!

As we did with ASP.NET MVC 1.0 and ASP.NET MVC 2, the source for the ASP.NET MVC 3 assembly is being released under the OSI certified Ms-PL license. The Ms-PL licensed source code is available as a zip file at the download center.

If you’d like to see the source code for ASP.NET Web Pages and our MVC Futures project, we posted that on CodePlex.com too.

What’s Next?

So what’s next? Well you can probably count as well as I can, so it’s time to start getting planning for ASP.NET MVC 4 and NuGet 2.0 in full gear. Though this time around, with NuGet now available, we have the means to easily distribute a lot of smaller releases throughout the year as packages, with the idea that many of these may make their way back into the core product. I’m sure you’ll see a lot of experimentation in that regard.

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

Comments

avatar

42 responses

  1. Avatar for MrDustpan
    MrDustpan January 12th, 2011

    Wow is that a full-on double rainbow, all the way?

  2. Avatar for Dmitry Podrezov
    Dmitry Podrezov January 12th, 2011

    Thank you so much for all the work. Hope you have real fun celebrating awsome release.

  3. Avatar for Quentin
    Quentin January 12th, 2011

    Awesome. I am excited to be a developer working on ASP.Net web sites. The .Net landscape has really become a fun space to work in. Keep up the great work!!

  4. Avatar for Chad Moran
    Chad Moran January 12th, 2011

    Thank you Phil, Scott, Scott and co! Don't know where I'd be without MVC. :)

  5. Avatar for Rich Turner
    Rich Turner January 12th, 2011

    Congratulations on wrapping this release up. MVC3 & Razor are possibly the most anticipated release of MVC ever and elevate Microsof't web platform way beyond almost every other web platform available.
    Great product from a great team :)

  6. Avatar for hcoverlambda
    hcoverlambda January 12th, 2011

    Great work. BTW, when are we going to see an installer-less distro of MVC? A zip distro would be nice for xcopy deployment strategies. Obviously the zip would only include the MVC bits and not the VS tools.

  7. Avatar for Richard Garside
    Richard Garside January 12th, 2011

    MVC 3, NuGet 1.0, IIS Express, Web matrix and Orchard 1.0 all released today. You Microsoft Guys have been busy. I know what I'll be doing this weekend.
    Thanks for all the hard work. Been working with the RC versions for a while and it's been great.

  8. Avatar for Aliaksei
    Aliaksei January 12th, 2011

    Phil, unfortunately the WebPages codeplex links doesn't work :(

  9. Avatar for Gideon Israel
    Gideon Israel January 12th, 2011

    I'm one whole day late! First time Ive been so anxious for an RTM release (Since I've never even tried an RC before =(
    You guys have done really amazing things with asp.net mvc 3...
    Downloading it now!..

  10. Avatar for Igorbek
    Igorbek January 13th, 2011

    Hello!
    I found some unexpected behavior when generating URL for actions: UriHelper.Action (or others) implictly takes route values from current context.
    For example:
    Routes:
    routes.MapRoute("User", "{userId}/{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new { userId = "^[1-9]\\d*$" });
    routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional});
    Controller:
    public class HomeController : Controller
    {
    public ActionResult Index() { return View(); }
    public ActionResult Test(int userId) { return View("Index"); }
    }
    View 'Index':
    Expected: "/", Actual: "@Url.Action("Index", "Home")"
    Expected: "/10/Home/Test", Actual: "@Url.Action("Test", "Home", new { userId = 10 })"
    Result of '/':
    Expected: "/", Actual: "/"
    Expected: "/10/Home/Test", Actual: "/10/Home/Test"
    All right!
    Result of '/10/Home/Test':
    Expected: "/", Actual: "/10"
    Expected: "/10/Home/Test", Actual: "/10/Home/Test"
    Why? The route value 'userId' set implictly from current route values into generated route link!
    Can you help me?

  11. Avatar for Aliaksei
    Aliaksei January 13th, 2011

    I stand corrected: the link works now :)

  12. Avatar for Raf
    Raf January 13th, 2011

    I would like to start learning asp.net mvc 3 (I'm windows programmer with few years experience). Is it a good idea to start reading a book about asp.net mvc 2 and then learn all changes from blogs/tutorials? or should I wait for a book about mvc 3? Thanks for answer.

  13. Avatar for Esmaltes
    Esmaltes January 13th, 2011

    Very good news ! I will start to convert my old sites now

  14. Avatar for Phil
    Phil January 13th, 2011

    Hi Phil - I get a fatal error installation message on Windows 7 32 bit. Any known issues?

  15. Avatar for Piers Lawson
    Piers Lawson January 13th, 2011

    Great news, I'll be looking into how it helps with my RESTful web services.

  16. Avatar for Matthew Hintzen
    Matthew Hintzen January 13th, 2011

    Compile blows up if you have the T4MVC.tt in your upgraded solution. while trying to compile the T4MVC.cs file you get the follow error:
    Error12The type 'System.Web.WebPages.Razor.WebRazorHostFactory' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

  17. Avatar for Matthew Hintzen
    Matthew Hintzen January 13th, 2011

    For the record on the MV3 not working with T4MVC, here is the work around: all you have to do is add a reference to the Razor dll. You will need to browse in the add reference dialog to find it. You will find it at "%ProgramFiles%\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies" add a reference to the System.Web.WebPages.Razor.dll to your project and things compile fine
    (Note on x64 OS %ProgramFiles% in this case denotes Program Files (x86)

  18. Avatar for shiju varghese
    shiju varghese January 13th, 2011

    Congrats for the awesome ASP.NET MVC 3

  19. Avatar for Bats Ihor
    Bats Ihor January 13th, 2011

    My congratulations! Very nice job. I am enjoying it!

  20. Avatar for Lederhos'n
    Lederhos'n January 13th, 2011

    Hi Phil,
    after installing RTM I get this error. I reinstalled the software but with no success :-(
    The composition produced a single composition error. The root cause is
    provided below. Review the CompositionException.Errors property for
    more detailed information.
    1) The element 'metadata' in namespace
    'schemas.microsoft.com/packaging/2010/07/nuspec.xsd' has
    invalid child element 'created' in namespace
    'schemas.microsoft.com/packaging/2010/07/nuspec.xsd'. List of
    possible elements expected: 'iconUrl, dependencies, licenseUrl,
    projectUrl, title, tags, summary, owners' in namespace
    'schemas.microsoft.com/packaging/2010/07/nuspec.xsd'.
    Resulting in: An exception occurred while trying to create an instance of
    type 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.
    Resulting in: Cannot activate part
    'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.
    Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow
    --> NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->
    AssemblyCatalog (Assembly="NuGet.Dialog, Version=1.0.11220.104,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
    Resulting in: Cannot get export
    'NuGet.Dialog.PackageManagerUI.PackageManagerWindow
    (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWi
    ndow")' from part
    'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.
    Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow
    (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWi
    ndow") --> NuGet.Dialog.PackageManagerUI.PackageManagerWindow
    --> AssemblyCatalog (Assembly="NuGet.Dialog,
    Version=1.0.11220.104, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a")

  21. Avatar for Fujiy
    Fujiy January 13th, 2011

    Phil, CachedDataAnnotationsMetadataProvider class shouldn´t be at MvcFutures? Its what release notes say.

  22. Avatar for Anton
    Anton January 13th, 2011

    Out of interest why does it take so long to install asp.net mvc (any version)? I'm referring to the actual installation after the download has completed?

  23. Avatar for Bob
    Bob January 13th, 2011

    I take the rainbow to mean that asp.net mvc is "inclusive", and is for everyone including apple employees...

  24. Avatar for ebb
    ebb January 14th, 2011

    "Improved support for Dependency Injection"
    Is there any examples up that shows how to use DI with MVC 3 RTM? - The post you refer to is outdated and none of the interfaces/classes is in the System.Web.MVC assembly?

  25. Avatar for haacked
    haacked January 14th, 2011

    @Fritz Check our Known Issues and start a discussion if you don't find anything.

  26. Avatar for Developer Seer
    Developer Seer January 14th, 2011

    Awesome, Just installed it and I'm going to test it right now!
    Just waiting for HanselScaffolding 1.0!
    Congratz Phill

  27. Avatar for Rodrigo Caballero
    Rodrigo Caballero January 14th, 2011

    Hi Phill,
    I have the RC 2 installed. Should I uninstall this release before the RTM?
    thanks a lot
    @rodrigo

  28. Avatar for haacked
    haacked January 14th, 2011

    @Rodrigo, no need to uninstall.
    @Developer, Check out Steve Sannderson's MvcScaffolding package!

  29. Avatar for Martin
    Martin January 14th, 2011

    This is great news. But I find your release notes a bit confusing.
    "Razor views do not have IntelliSense support nor syntax highlighting. It is anticipated that support for Razor syntax in Visual Studio will be included as part of a later release."
    Is this from an old version ? Because intellisense and syntax highlighting works fine on my computer.
    Also you mention that you need to include
    <add key="enableSimpleMembership" value="false" />
    <add key="autoFormsAuthentication" value="false" />
    In the web.config, but these settings are not included when creating a new MVC 3 project. So are they really needed or did you forget to remove it ?

  30. Avatar for Matthew Hintzen
    Matthew Hintzen January 15th, 2011

    More information on the T4MVC.tt error during build: Error 12 The type 'System.Web.WebPages.Razor.WebRazorHostFactory' is defined in an assembly that is not referenced.
    This seems to only show up when you have set <MvcBuildViews>true</MvcBuildViews> in the project file. Either set the value to false (or delete it) from the csproj file or add a reference to the .dll (depending on which work around seems "correct" to you)

  31. Avatar for dotnetstep
    dotnetstep January 15th, 2011

    Hello All,
    Is that MVC 3 support conditional validation ?
    Is that MVC 3 support validation group ?
    Can i disable and enable validation for individual control from javascript ?
    Thanks.

  32. Avatar for stuhin
    stuhin January 15th, 2011

    Hi Phil,
    method RedirectToAction
    MVC3RC:
    routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}/{id2}/{id3}",
    new
    {
    controller = "Home",
    action = "Index",
    id = UrlParameter.Optional,
    id2 = UrlParameter.Optional,
    id3 = UrlParameter.Optional
    });
    MVC3RTM need to paint the full, otherwise RedirectToAction("Action") bag:
    routes.MapRoute(
    "Default3",
    "{controller}/{action}/{id}/{id2}/{id3}",
    new
    {
    controller = "Home",
    action = "Index",
    id = UrlParameter.Optional,
    id2 = UrlParameter.Optional,
    id3 = UrlParameter.Optional
    });
    routes.MapRoute(
    "Default2",
    "{controller}/{action}/{id}/{id2}",
    new
    {
    controller = "Home",
    action = "Index",
    id = UrlParameter.Optional,
    id2 = UrlParameter.Optional
    });
    routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}",
    new
    {
    controller = "Home",
    action = "Index",
    id = UrlParameter.Optional
    });
    UrlParameter.Optional - optional?
    regards
    stuhin

  33. Avatar for Janos
    Janos January 16th, 2011

    Hi Phil,
    Do you know if MVC3 debug symbols are available on MS Symbol server?
    I am trying to step into the source following this article weblogs.asp.net/..., but I managed to make it work only with MVC2 but not with MVC3.
    I suppose the debug symbols are not yet available on the server, because if I check FailedLoads folder in SymbolCache I can see System.Web.Mvc_v4.0_3.0.0.0 file containing a "PDB Not Found" text.
    Thanks
    Janos

  34. Avatar for Henning Anderssen
    Henning Anderssen January 16th, 2011

    Great news.
    What about the Futures library? I can't see any released binaries of it.
    I've been looking into creating some Spark templates. Do you have any information as to how I can do that easily?
    Thanks

  35. Avatar for counsellorben
    counsellorben January 16th, 2011

    @dotnetstep,
    1. Conditional validation. Yes, you can create your own client and server side conditional validators.
    2. Validation groups. Here is a link to a great tip to create "validation groups" using the jquery.validate library which powers MVC 3 unobtrusive validation: http://encosia.com/2009/11/24/asp-net-webforms-validation-groups-with-jquery-validation/
    counsellorben

  36. Avatar for Malcolm
    Malcolm January 17th, 2011

    Hi Phil,
    One question has always been on my mind. Why release the code as open source? Can members of the community updates patches and commit the code to a central repository?

  37. Avatar for Todd
    Todd February 2nd, 2011

    Think I found a bug. There is apparently a known issue when you use the [Authorize] attribute on an action method or class, it redirects to "Account/Login" instead of deferring to config setting in web.config (see Sean Paul's comments @ haacked.com/.../asp-net-mvc-3-beta-released.aspx). The solution was to add <add key="AutoFormsAuthentication" value="false" /> to the <appSettings> of web.config. But that didn't work for me.
    To recreate: Make new MVC website (with all default "home", "about" template stuff in there). Set [Authorize] attrib to Home controller class. Move the _ViewStart.cshtml to the root of the app (this is to have all Areas use the same layout page - instead of just the default/root area). Boom. Any other workarounds?

  38. Avatar for hilton smith
    hilton smith February 20th, 2011

    Hey phil, loving mvc3 and all that jazz except for the "Add View" dialog and its strongly typed dropdown.
    As of this morning the strongly typed view dropdown lists every single class from every single one of my dependencies EXCEPT for the types from my actual web project.
    I've cleaned, rebuilt, rebooted, searched stackoverflow and am pretty close to slaughtering a goat to sacrifice to the Gods of Add View Dialogs in the vain hope that appeasing them will bring back my classes and allow me to quickly add views instead of making me type them out myself.
    Is there any place I can go to find out just how that dropdown is populated and what I need to delete in order for it to be rebuilt? The goat hopes there is....

  39. Avatar for Sven
    Sven February 22nd, 2011

    Regarding the above question about whether MVC 3 supports conditional validation, it was above answered by "counsellorben Jan 17, 2011 9:08 AM" with the words "Yes, you can create your own client and server side conditional validators.".
    My follow-up-question is then if you can define the validation logic once (into some kind of metadata validation model which can be used for geneating the javascript code) or you still need to duplicate it manually in C# code and in JavaScript code ?
    If so, can somebody provide a link to a code example ?
    (for the readers of this blog that is also interested in this question can also watch out the new thread I created today at stackoverflow.com/...
    )

  40. Avatar for Ramil Akhmetov
    Ramil Akhmetov March 2nd, 2011

    Thanks for this release!

  41. Avatar for haacked
    haacked March 4th, 2011

    @Hilton we look for all public types in the current project and in referenced assemblies. We filter out types in certain System and Microsoft namespaces, etc.

  42. Avatar for simon horridge
    simon horridge May 16th, 2011

    for a fix to ASP.NET MVC 3 Tools Update Setup fails with fatal error (0x80070643) go to:
    greuel.name/...