--- uid: whitepapers/mvc3-release-notes title: "ASP.NET MVC 3 | Microsoft Docs" author: rick-anderson description: "" ms.author: riande ms.date: 10/06/2010 ms.assetid: f44c166e-7e91-48a0-a6f8-d9285f3594e5 msc.legacyurl: /whitepapers/mvc3-release-notes msc.type: content --- ASP.NET MVC 3 ==================== - [Overview](#overview) - [Installation Notes](#installation-notes) - [Software Requirements](#software-requirements) - [Documentation](#documentation) - [Support](#support) - [Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update](#upgrading) - [ASP.NET MVC 3 Tools Update (April 12, 2011)](#tu-changes) - ["Add Controller" dialog box can now scaffold controllers with views and data access code](#tu-AddControllerDialog) - [Improvements to the "ASP.NET MVC 3 New Project" Dialog Box](#tu-ImprovementsNewDialogBox) - [Project templates now include Modernizr 1.7](#tu-Modernizr) - [Project templates include updated versions of jQuery, jQuery UI, and jQuery Validation](#tu-UpdatedJQuery) - [Project templates now include ADO.NET Entity Framework 4.1 as a pre-installed NuGet package](#tu-EF) - [Project templates include JavaScript libraries as pre-installed NuGet packages](#tu-JavaScriptLibsNuget) - [Known Issues](#tu-KI) - [ASP.NET MVC 3 RTM (January 13, 2011)](#MVC3RTM) - [Change: Updated the version of jQuery UI to 1.8.7](#RTM-1) - [Change: Changed the default ModelMetadataProvider back to DataAnnotationsModelMetadataProvider](#RTM-2) - [Fixed: Pasting part of a Razor expression that contains whitespace results in it being reversed](#RTM-3) - [Fixed: Renaming a Razor file that is opened in the editor disables syntax colorization and IntelliSense](#RTM-4) - [Known Issues](#RTM-KI) - [Breaking Changes](#RTM-BC) - [ASP.NET MVC 3 Release Candidate 2 (December 10, 2010)](#_Toc2) - [Project Templates Changed to Include jQuery 1.4.4, jQuery Validation 1.7, and jQuery UI 1.8.6y UI 1.8.6](#_Toc2_1) - [Added "AdditionalMetadataAttribute" Class](#_Toc2_2) - [Improved View Scaffolding](#_Toc2_3) - [Added Html.Raw Method](#_Toc2_3) - [Renamed "Controller.ViewModel" Property and the "View" Property To "ViewBag"](#_Toc2_4) - [Renamed "ControllerSessionStateAttribute" Class to "SessionStateAttribute"](#_Toc2_5) - [Renamed RemoteAttribute "Fields" Property to "AdditionalFields"](#_Toc2_6) - [Renamed "SkipRequestValidationAttribute" to "AllowHtmlAttribute"](#_Toc2_7) - [Changed "Html.ValidationMessage" Method to Display the First Useful Error Message](#_Toc2_8) - [Fixed @model Declaration to not Add Whitespace to the Document](#_Toc2_9) - [Added "FileExtensions" Property to View Engines to Support Engine-Specific File Names](#_Toc2_10) - [Fixed "LabelFor" Helper to Emit the Correct Value for the "For" Attribute](#_Toc2_11) - [Fixed "RenderAction" Method to Give Explicit Values Precedence During Model Binding](#_Toc2_12) - [Breaking Changes](#_Toc2_BC) - [Known Issues](#_Toc2_KI) - [ASP.NET MVC 3 Release Candidate (Nov 9, 2010)](#TOC_ASP_NET_3_RC) - [New Features in ASP.NET MVC 3 RC](#_Toc276711785) - [NuGet Package Manager](#_Toc276711786) - [Improved "New Project" Dialog Box](#_Toc276711787) - [Sessionless Controllers](#_Toc276711788) - [New Validation Attributes](#_Toc276711789) - [New Overloads for "LabelFor" and "LabelForModel" Methods](#_Toc276711790) - [Child Action Output Caching](#_Toc276711791) - ["Add View" Dialog Box Improvements](#_Toc276711792) - [Granular Request Validation](#_Toc276711793) - [Breaking Changes](#_Toc276711794) - [Known Issues](#_Toc276711795) - [ASP.MVC 3 Beta Notes (Oct 6, 2010)](#TOC_ASP_NET_3_Beta) - [New Features in ASP.NET MVC 3 Beta](#0.1__Toc274034215) - [NuPack Package Manager](#0.1__Toc274034216) - [Improved New Project Dialog Box](#0.1__Toc274034217) - [Simplified Way to Specify Strongly Typed Models in Razor Views](#0.1__Toc274034218) - [Support for New ASP.NET Web Pages Helper Methods](#0.1__Toc274034219) - [Additional Dependency Injection Support](#0.1__Toc274034220) - [New Support for Unobtrusive jQuery-Based Ajax](#0.1__Toc274034221) - [New Support for Unobtrusive jQuery Validation](#0.1__Toc274034222) - [New Application-Wide Flags for Client Validation and Unobtrusive JavaScript](#0.1__Toc274034223) - [New Support for Code that Runs Before Views Run](#0.1__Toc274034224) - [New Support for the VBHTML Razor Syntax](#0.1__Toc274034225) - [More Granular Control over ValidateInputAttribute](#0.1__Toc274034226) - [Helpers Convert Underscores to Hyphens for HTML Attribute Names Specified Using Anonymous Objects](#0.1__Toc274034227) - [Bug Fixes](#0.1__Toc274034228) - [Breaking Changes](#0.1__Toc274034229) - [Known Issues](#0.1__Toc274034230) - [Disclaimer](#0.1__Toc274034231) ## Overview This document describes the release of ASP.NET MVC 3 RTM for Visual Studio 2010. ASP.NET MVC is a framework for developing Web applications that uses the Model-View-Controller (MVC) pattern. The ASP.NET MVC 3 installer includes the following components: - ASP.NET MVC 3 runtime components - ASP.NET MVC 3 Visual Studio 2010 tools - ASP.NET Web Pages run-time components - ASP.NET Web Pages Visual Studio 2010 tools - Microsoft Package Manager for .NET (NuGet) - An update for Visual Studio 2010 that enables support for Razor syntax. (For details, see KnowledgeBase article 2483190.) The full set of release notes for each pre-release version of ASP.NET MVC 3 can be found on the ASP.NET website at the following URL: https://www.asp.net/learn/whitepapers/mvc3-release-notes ## Installation Notes To install ASP.NET MVC 3 RTM using the Web Platform Installer (Web PI), visit the following page: [https://www.microsoft.com/web/gallery/install.aspx?appid=MVC3](https://www.microsoft.com/web/gallery/install.aspx?appid=MVC3) Alternatively, you can download the installer for ASP.NET MVC 3 RTM for Visual Studio 2010 from the following page: https://go.microsoft.com/fwlink/?LinkID=208140 ASP.NET MVC 3 can be installed and can run side-by-side with ASP.NET MVC 2. ## Software Requirements The ASP.NET MVC 3 run-time components require the following software: - .NET Framework version 4. ASP.NET MVC 3 Visual Studio 2010 tools require the following software: - Visual Studio 2010 or Visual Web Developer 2010 Express. ## Documentation Documentation for ASP.NET MVC is available on the MSDN Web site at the following URL: [https://go.microsoft.com/fwlink/?LinkId=205717](https://go.microsoft.com/fwlink/?LinkId=205717) Tutorials and other information about ASP.NET MVC are available on the MVC page of the ASP.NET Web site at the following URL: [https://www.asp.net/mvc/](../mvc/index.md) ## Support This is a fully supported release. Information about getting technical support can be found at the [Microsoft Support website](https://support.microsoft.com/). Also feel free to post questions about this release to the ASP.NET MVC forum, where members of the ASP.NET community are frequently able to provide informal support: [https://forums.asp.net/1146.aspx](https://forums.asp.net/1146.aspx) ## Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update ASP.NET MVC 3 can be installed side by side with ASP.NET MVC 2 on the same computer, which gives you flexibility in choosing when to upgrade an ASP.NET MVC 2 application to ASP.NET MVC 3. To manually upgrade an existing ASP.NET MVC 2 application to version 3, do the following: 1. Create a new empty ASP.NET MVC 3 project on your computer. This project will contain some files that are required for the upgrade. 2. Copy the following files from the ASP.NET MVC 3 project into the corresponding location of your ASP.NET MVC 2 project. You'll need to update any references to the jQuery library to account for the new filename ( jQuery-1.5.1.js): - /Views/Web.config - /packages.config - /scripts/\*.js - /Content/themes/\*.\* 3. Copy the *packages* folder in the root of the empty ASP.NET MVC 3 project solution into the root of your solution, which is in the directory where the solution's .sln file is located. 4. If your ASP.NET MVC 2 project contains any areas, copy the /Views/Web.config file to the *Views* folder of each area. 5. In both Web.config files in the ASP.NET MVC 2 project, globally search and replace the ASP.NET MVC version. Find the following: [!code-console[Main](mvc3-release-notes/samples/sample1.cmd)] Replace it with the following: [!code-console[Main](mvc3-release-notes/samples/sample2.cmd)] 6. In Solution Explorer, delete the reference to *System.Web.Mvc* (which points to the DLL from version 2), then add a reference to *System.Web.Mvc* (v3.0.0.0). 7. Add a reference to System.Web.WebPages.dll and System.Web.Helpers.dll. These assemblies are located in the following folders: - %ProgramFiles%\ Microsoft ASP.NET\ASP.NET MVC 3\Assemblies - %ProgramFiles%\ Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies 8. In Solution Explorer, right-click the project name and select Unload Project. Then right-click the project name again and select Edit *ProjectName*.csproj. 9. Locate the *ProjectTypeGuids* element and replace {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}. 10. Save the changes, right-click the project, and then select Reload Project. 11. In the application's root Web.config file, add the following settings to the *assemblies* section. [!code-xml[Main](mvc3-release-notes/samples/sample3.xml)] 12. If the project references any third-party libraries that are compiled using ASP.NET MVC 2, add the following highlighted *bindingRedirect* element to the Web.config file in the application root under the *configuration* section: [!code-xml[Main](mvc3-release-notes/samples/sample4.xml)] ## Changes in ASP.NET MVC 3 Tools Update This section describes changes made in the ASP.NET MVC 3 Tools Update release since the ASP.NET MVC 3 RTM release. ### "Add Controller" dialog box can now scaffold controllers with views and data access code Scaffolding is a way of quickly generating a controller and views for your application. After the code has been generated, you can edit it to meet your project's requirements. To launch the *Add Controller* dialog box in ASP.NET MVC 3, right-click the *Controllers* folder in *Solution Explorer*, click *Add*, and then click *Controller*. The dialog box has been enhanced to offer additional scaffolding options. ![](mvc3-release-notes/_static/image1.png) There are three scaffolding templates available by default. #### Empty Controller This template generates an empty controller file. This template is equivalent to not checking *Add actions for create, edit, details, delete scenarios* in previous versions of ASP.NET MVC. If you choose this, no further options are available. #### Controller with empty read/write actions This template generates a controller file that has all the required action methods but no implementation code in the methods. This template is equivalent to checking *Add actions for create, edit, details, delete scenarios* in previous versions of ASP.NET MVC. If you choose this, no further options are available. #### Controller with read/write actions and views, using Entity Framework This template enables you to quickly create a working data-entry user interface. It generates code that handles a range of common requirements and scenarios, such as the following: - *Data access*. The generated code reads and writes entities in a database. It works with the Entity Framework Code First approach if you choose an existing data context class or if you let the template generate a new *DbContext* class. It also works with the Entity Framework Database First or Model First approach if you choose an existing *ObjectContext* class. - *Validation*. The generated code uses ASP.NET MVC model binding and metadata features so that form submissions are validated according to rules declared on your model class. This includes built-in validation rules, such as the *Required* and *StringLength* attributes, and custom validation rules. - *One-to-many relationships*. If you define one-to-many foreign-key relationships between your model classes, the generated code will produce drop-down lists for selecting related entities. For example, you might define the following model classes following Entity Framework Code First conventions: [!code-csharp[Main](mvc3-release-notes/samples/sample5.cs)] When you then scaffold a controller for the *Product* class, its views will allow users to choose a *Category* object for each *Product* instance. This template enables additional options in the *Add Controller* dialog box. For *Model class*, you can choose any model class in your solution, which determines the type of data that users will be able to create or edit: - If you want to use Entity Framework Code First, you can choose any model class. - If you are using Entity Framework Database First or Entity Framework Model First, be sure to choose an entity class defined in your conceptual model. For *Data Context class*, you can make these choices: - If you want to use Code First and have no existing data context class, choose **New data context **. A data context class will then be generated for you. - If you want to use Code First and have an existing data context class, choose it here. It will be updated to persist the model class you have selected. - If you are using Database First or Model First, choose your object context class here. For Views, choose the view engine you want to use, or choose None if you don't want to scaffold any views. You can select Advanced Optionsto specify further options for the generated views. For example, you can choose the layout or master page to use. ### Improvements to the "ASP.NET MVC 3 New Project" Dialog Box The dialog box you use to create new ASP.NET MVC 3 projects includes multiple improvements, as listed below. ![](mvc3-release-notes/_static/image2.png) #### New "Intranet Project" Template The Project Template list includes a new Intranet Application template. This template contains settings for building a web application using Windows authentication instead of forms authentication. Because an intranet application requires some IIS settings that can't be encapsulated in a project template, the template includes a readme file with instructions for how to make the project template work in IIS. Documentation for the a new Intranet Application template is available on the MSDN website at the following URL: [https://msdn.microsoft.com/library/gg703322(VS.98).aspx](https://msdn.microsoft.com/library/gg703322(VS.98).aspx) #### Project templates are now HTML5 enabled The new-project dialog box now contains an option to add HTML5-specific features to the project templates. Selecting the option causes views to be generated that contain the new HTML5 `
`, `