Partilhar via


ASP.NET 4.5 and Visual Studio 2012

The .NET Framework 4.5 includes enhancements for ASP.NET 4.5. Visual Studio 2012 also includes enhancements and new features for improved web development. This document provides an overview of many of the new features that are included in Visual Studio 2012. For more detailed information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website.

This topic contains the following sections:

  • Learn What's New By Tutorial

  • Learn What's New By Feature

  • Additional Resources

Learn What's New By Tutorial

The following table lists new tutorials for ASP.NET 4.5 and Visual Studio 2012.

ASP.NET 4.5 Web Forms

Title

Description

Getting Started with ASP.NET 4.5 Web Forms (5 Tutorials) (ASP.NET website)

This tutorial series will teach you the basics of building an ASP.NET Web Forms application using ASP.NET 4.5 and Microsoft Visual Studio Express 2012 for Web.

Strongly Typed Data Controls (Scott Guthrie's blog)

This post explains how to enable strongly typed data templates in ASP.NET 4.5 Web Forms.

Model Binding and Web Forms (ASP.NET website)

This tutorial series shows how to build an ASP.NET 4.5 Web Forms application that uses model binding.

New Bundling and Minification Support (Scott Guthrie's blog)

This post explains bundling and minification support in ASP.NET 4.5 Web Forms.

Using Page Inspector in ASP.NET Web Forms (ASP.NET website)

This topic introduces Page Inspector (visual mapping between the browser, source view, and CSS) within the context of a Web Forms project.

ASP.NET MVC

Title

Description

Intro to ASP.NET MVC 4 with Visual Studio 2012

This tutorial will teach you the basics of building an ASP.NET MVC Web application using Visual Studio Express 2012 for Web.

Using Asynchronous Methods in ASP.NET MVC 4

This tutorial series will teach you the basics of building an asynchronous ASP.NET MVC 4 application.

ASP.NET MVC 4 Mobile Features

This tutorial will teach you the basics of how to work with mobile features in an ASP.NET MVC 4.

Using Page Inspector in ASP.NET MVC

This topic introduces Page Inspector (visual mapping between the browser, source view, and CSS) within the context of an ASP.NET MVC project.

Using Page Inspector in ASP.NET MVC (video)

This video shows the benefits of using Page Inspector in ASP.NET MVC web applications.

Visual Studio 2012

Title

Description

Features No One Noticed in Visual Studio Express for Web (Scott Hanselman's blog)

This blog entry covers the Browser chooser in the toolbar, image file thumbnails in Solution Explorer, CSS color picker, Page Inspector, and more.

Web Developer Efficiency Tools in Visual Studio (Channel 9 video)

This video reviews changes in the HTML editor, CSS editor, Page Inspector, and JavaScript editor.

My Top 5 Visual Studio Designer Improvements for ASP.NET 4.5 Development (Telerik) (Telerik blog)

This blog entry reviews JavaScript IntelliSense, jQuery IntelliSense and documentation, Page Inspector, CSS vendor-specific IntelliSense, CSS color selection.

ASP.NET Web Pages 2

Title

Description

The Top Features in Web Pages 2

This article documents common tasks that you can perform using new features in ASP.NET Web Pages.

Introducing ASP.NET Web Pages 2

This tutorial set uses the WebMatrix tool to provide an overview of ASP.NET Web Pages 2 and Razor syntax.

What's New in Razor v2

This blog entry covers new features like updated support for the ~ operator and the new conditional attributes.

Updated validation in Web Pages v2

This blog entry is the first in a series of three that explores the new Validation helper in ASP.NET Web Pages 2.

Learn What's New By Feature

The following table lists technology areas each containing new features for ASP.NET 4.5 and Visual Studio 2012.

These features include the following:

ASP.NET Core Services

The following table lists new features for core ASP.NET functionality.

Feature

Description

Resources

Asynchronously reading and writing HTTP requests and responses

ASP.NET 4.5 can read, write, and flush a stream asynchronously. This asynchronicity lets you send data to a client incrementally without tying up operating system threads.

Asynchronously Reading and Writing HTTP Requests and Responses (What's New whitepaper)

Support for reading unvalidated request data when request validation is enabled

ASP.NET 4.5 provides ways to read unvalidated request data so that you can allow users to pass markup for selected fields or pages.

New ASP.NET Request Validation Features (What's New whitepaper)

Support for WebSockets protocol

Methods in the new System.Web.WebSockets namespace provide support for WebSockets protocol, which lets you read and write both string and binary data.

Support for WebSockets Protocol (What's New whitepaper)

Bundling and minification of client scripts

ASP.NET 4.5 uses bundling (which combines separate JavaScript files for faster loading) and minification (which reduces the size of JavaScript and CSS files by removing unneeded characters). The ASP.NET bundling and minification library is also supported by the ScriptManager control.

New Bundling and Minification Support (ASP.NET 4.5 Series) (blog entry)

Bundling and Minification (article)

Bundling and Minification in ASP.NET 4.5 (blog entry)

Support for asynchronous modules and handlers

The new async and await keywords make it easier to write asynchronous HTTP modules and asynchronous HTTP handlers. Updates to asynchronous development include:

ClientDisconnectedToken: A CancellationToken that asynchronously notifies the application when a client has disconnected from the underlying web server.

TimedOutToken: A CancellationToken that asynchronously notifies the application when a request has run longer than the configured request timeout value.

ThreadAbortOnTimeout: If you want your application to control the behavior of timed out requests, set this property to false. When the property is set to true (the default), ASP.NET aborts the thread that is servicing the request when the request times out.

Abort: Use this method in your application to forcibly terminate the underlying TCP connection of a request. Any outstanding I/O will fail.

Support for await and Task-Based Asynchronous Modules and Handlers (What's New whitepaper)

Using Asynchronous Methods in ASP.NET 4.5 (tutorial)

Using Asynchronous Methods in ASP.NET MVC 4 (tutorial)

async (C# Reference) (MSDN Library)

await (C# Reference) (MSDN Library)

Integrated Anti-XSS encoding routines

Anti-XSS (cross-site scripting) core encoding routines have been integrated into ASP.NET 4.5. These routines were previously available only as an external library.

Anti-XSS Library (What's New whitepaper)

Support for OAuth and OpenID

OAuth and OpenID let you create sites that permit users to sign in with credentials from other sites, including Google, Yahoo, Facebook, Twitter, and Windows Live.

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website.

ASP.NET Web Forms

The following table lists some of the enhancements that have been made for Web Forms in ASP.NET 4.5.

Feature

Description

Resources

Model binders

Web Forms now supports model binding, which lets you bind data controls directly to data-access methods. ASP.NET automatically converts data from form fields, query strings, cookies, session state, and view state into method parameters. You can use these parameters to select data from or make updates to the database. (This technique is similar to model binding in ASP.NET MVC.)

Model Binding and Web Forms (tutorial series)

Model Binding (What's New whitepaper)

Model Binding Part 1 - Selecting Data (video)

Model Binding Part 2 - Filtering (video)

Strongly typed binding expressions in data controls

You can now write strongly typed, two-way data-binding expressions in Web Forms data controls, instead of using Bind or Eval expressions. This approach lets you access complex properties in data controls. These expressions can be used with the new model binding feature.

Strongly typed data controls (What's New whitepaper)

Strongly Typed Data Controls (blog entry)

Strongly typed data controls (video)

Unobtrusive JavaScript for client-side validation

Unobtrusive validation moves the code for client-side validation into a single external JavaScript file, which makes pages smaller and faster to load. It also provides better caching of script files.

Unobtrusive Validation (What's New whitepaper)

HTML encoded data-binding expressions

New syntax lets you encode HTML output in page markup.

HTML Encoded Data-Binding Expressions (What's New whitepaper)

Fallback support for content distribution networks (CDNs) in the ScriptManager control

When you set the EnableCdn property of the ScriptManager control, the control tests whether the script was loaded successfully from the CDN. If not, the control falls back to loading the script from an alternate (local) location.

ASP.NET 4.0 ScriptManager Improvements (blog entry)

Announcing the Microsoft AJAX CDN (blog entry)

Support for HTML5 form types

You can use HTML5 elements like email, tel, url, and search in Web Forms pages.

HTML5 Updates (What's New whitepaper)

HTML 5 Input Types on WebForms Controls (blog entry)

Improved paging in the GridView control

The new AllowCustomPaging and VirtualItemCount properties of the GridView control let you customize paging functionality. These new properties remove the need for the control to retrieve all rows from the data source each time a new page is displayed.

AllowCustomPaging (MSDN Library)

VirtualItemCount (MSDN Library)

Enhancements to Web Forms compilation

The following improvements extend the Web Forms compilation system:

- A new ControlBuilderInterceptor class lets you customize Web Forms page and control compilation output.

- A new TemplateParser.ParseTemplate method lets you generate an ITemplate instance from a string of ASPX markup.

ControlBuilderInterceptor (MSDN Library)

ParseTemplate (MSDN Library)

ITemplate (MSDN Library)

Visual Studio 2012 RC is released - The Big Web Rollup (Scott Hanselman blog)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website and ASP.NET Data Access Content Map.

ASP.NET MVC 4

ASP.NET MVC 4 is available for Visual Studio 2010 SP1 at the Microsoft Download Center and for Visual Studio 2012 at ASP.NET MVC 4.

For information about new features in this release, see the following links on the ASP.NET website:

ASP.NET Web Pages 2

The ASP.NET Web Pages 2 is included in Visual Studio 2012 and Visual Studio Express 2012 for Web. You can also obtain it by using the Microsoft Web Platform Installer to download and install WebMatrix.

The following table lists enhancements for ASP.NET Web Pages that are included in the Web Pages 2.

Feature

Description

Resources

New and enhanced site templates

A new Personal Site template provides pages for a blog, a photo gallery, and Twitter content. The Starter Site template has been updated to let users log in to your site by using Facebook, Twitter, and Windows Live. The Web Pages 1 site templates have also been upgraded to run on Web Pages 2.

The Top Features in Web Pages 2 (ASP.NET website)

Razor syntax improvements

Razor syntax now supports conditional HTML attributes, which makes it much simpler to render attributes based on values that you set in code. The new ~/ syntax also now makes it much simpler to render dynamic path information in links and URLs.

The Top Features in Web Pages 2 (ASP.NET website)

Validation

New options for validating user input are available, including client-side validation (which helps improve the performance of your site). New validation classes (ValidationHelper and Validator) help you specify validation rules by using just a few lines of code.

The Top Features in Web Pages 2 (ASP.NET website)

Side-by-side support

You can run existing Web Pages 1 applications and new Web Pages 2 applications on the same computer.

The Top Features in Web Pages 2 (ASP.NET website)

Membership and authentication

Web Pages supports new OAuth and OpenID authentication providers, which let users log in using external sites such as Facebook, Twitter, and Windows Live. The new Starter Site template includes examples of how to use the new providers.

The Top Features in Web Pages 2 (ASP.NET website)

Map helper

A new Map helper lets you call existing map engines (such as Bing, Google, Yahoo, and MapQuest) and render maps on your website.

The Top Features in Web Pages 2 (ASP.NET website)

Mobile display modes

A new Display Modes feature lets you create device-specific pages. The pages are rendered automatically based on the device that makes the request, such as a mobile device.

The Top Features in Web Pages 2 (ASP.NET website)

For more information about the ASP.NET Web Pages 2 release, see The Top Features in Web Pages 2 on the ASP.NET website.

ASP.NET MVC 4, Web API, and ASP.NET Web Pages (Razor) are now Open Source

ASP.NET MVC 4, ASP.NET Web API, and ASP.NET Web Pages v2 (Razor syntax) are now under the Apache 2.0 license. The essential points of this development model are as follows.

  • Source code location. The source code is available on CodePlex at https://aspnetwebstack.codeplex.com/ and uses Git for version control.

  • See check-ins and provide feedback. The community can see and provide feedback on developer check-ins both from Microsoft and from the community.

  • Community contributions. Developers outside of Microsoft community can submit patches and code contributions.

  • Check-ins are evaluated. The Microsoft development team reviews every check-in (open source or otherwise) for inclusion. Every check-in is evaluated against existing standards.

  • Community code is included in Visual Studio. The community code approved for inclusion in ASP.NET is included in Visual Studio.

  • Microsoft development and support continue. ASP.NET MVC, Web API and Razor continue to be developed by Microsoft and ship both standalone as well as part of Visual Studio. They continue to be supported by existing Microsoft support policy.

  • Web Forms. Web Forms has not been made open source because it is part of System.Web.dll which the Windows Server platform takes a dependency on. Because of this dependency, the code cannot easily be replaced except when the .NET framework or the OS are updated.

For more information, see:

Editor Enhancements

The following sections provide information about editor enhancements and new features in the Visual Studio 2012 release.

Note

The HTML5 and CSS3 features included in the Web Standards Update for Microsoft Visual Studio 2010 SP1 release are also in Visual Studio 2012.

The following features in the web page designer are either new or have been enhanced for the Visual Studio 2012 release.

Multibrowser Support

Installed browsers appear in a new drop-down list next to the Start Debugging button in Visual Studio. This feature lets you test the same page, application, or site in different browsers. To test in several browsers simultaneously, choose the Browse With option from the drop-down list, and then use CTRL-click to select multiple browsers. When you press F5 or CTRL+F5, your application will launch in all of the browsers that you selected. To set multiple browsers as the default, use Browse With to select multiple browsers, and then choose Set as Default from within the Browse With dialog box.

Page Inspector

Page Inspector is a tool that renders a web page (HTML, Web Forms, ASP.NET MVC, or Web Pages) directly within the Visual Studio IDE. You can use Page Inspector to examine both the source code and the resulting output. For ASP.NET pages, you can use Page Inspector to determine which server-side code has produced the HTML markup that is rendered to the browser. Page Inspector works even when the default ASP.NET bundling and minification features are enabled.

Requirements

To use Page Inspector, you must have the following:

  • Visual Studio 2012 installed on your computer.

  • .NET Framework 4.5 installed on your computer.

  • A Web application that targets the .NET Framework 4 or later.

Note

Page Inspector hosts the current version of Internet Explorer in Visual Studio. For full functionality, you must have Internet Explorer 9 installed on your computer. You do not have to have Internet Explorer Platform Preview (also called Internet Explorer 10 Test Drive) installed.

Features

Feature

Description

Selection mapping

When you select markup in the source, the corresponding output is automatically highlighted in Page Inspector, and vice versa.

Inspect Mode

Click the arrow icon on the Page Inspector tools pane to put Page Inspector into inspection mode. In inspection mode, when you hold the mouse pointer over any part of the rendered page, the corresponding source markup or code is highlighted. In Solution Explorer, the corresponding file is also highlighted.

Sandbox testing of CSS/DOM changes

Page Inspector lets you modify CSS properties and DOM element attributes and see the changes reflected immediately in the browser. These changes are not persisted and the original source files are unaffected.

CSS Rule Mapping and Modification

When you click a rule in the CSS tools grid, Page Inspector opens the corresponding .css file to where the rule is defined. The complete rule is selected. This feature makes it easy for you to get to where the rule is defined so that you can modify it as necessary.

Update bar

When you change the page source, an update bar appears at the top of the viewer. The Update Bar prompts you to click the bar (or press CTRL+ALT+ENTER) to save the changes and refresh the rendered view.

Source file links

A Files tab on the Page Inspector tools pane contains links to all of the files that make up the current page. To open one of the files in the Visual Studio editor, click the file link.

Page Inspector in the default browser list

Page Inspector appears as an option in the drop-down list of browsers next to the Start Debugging icon in Visual Studio.

Resources

HTML Editor

The HTML editor in Visual Studio provides support for HTML5. The following table lists additional enhancements.

Feature

Description

Resources

Improved IntelliSense

As you type, IntelliSense reduces the options that are displayed to only the ones that contain the string that you typed. Matches can occur at the beginning, middle, or end. IntelliSense and validation have been updated to conform to the latest HTML5 and W3C standards.

Auto-reduce statement completion (What's New whitepaper)

Schema switching based on document type

You can configure the HTML editor to use a page's <!DOCTYPE> and <html> tags to automatically set the schema to use for validating the page markup.

Validation, HTML, Text Editor, Options Dialog Box (MSDN UI reference)

Tag completion when renaming tags

If you change a tag name (for example, <p> to <list>), the editor changes the corresponding beginning or end tag (for example, </p> automatically becomes </list>.

Automatic renaming of matching tag when you rename an opening or closing tag (What's New whitepaper)

Extract selected markup to a user control

In the editor, you can save selected select markup as a user control, which is a convenient way to create markup for use in multiple locations. To do this, right-click the selection, choose Extract to User Control, and then save the markup.

Extract to User Control (What's New whitepaper)

Smart indentation for empty elements

IF the insertion pointer is between an empty pair of tags (for example, <p></p>), when you press ENTER, the editor creates a new line. It puts the insertion point in an indented position on the new line, as in the following example:

<p>    |</p>

Smart Indent (What's New whitepaper)

Smart Task feature for HTML elements

Smart Tasks appear on HTML tags as a small arrow when the insertion point is inside the element. Click the arrow or press CTRL+. (dot) to display a small menu that helps you complete tasks related to the element. Smart Tasks are available in source view for all HTML elements and are extensible through the Managed Extensibility Framework.

HTML Editor Smart Tasks and Event Handler Generation

Event handler generation in source view

When you edit an event name in source view, you can use IntelliSense to create an event handler in the code that has the correct signature.

Event handler generation (What's New whitepaper)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website.

CSS Editor

The most significant change in the Visual Studio 2012 CSS editor is support for CSS3. For more information about CSS3, see www.css3.info. The following table lists additional enhancements to the CSS editor in Visual Studio 2012.

Feature

Description

Resources

Collapse/expand (outlining)

The expand and collapse feature (outlining) from the HTML page editor in Visual Studio has been added to CSS sections and commented section headings in .css files.

Custom regions (What's New whitepaper)

Auto formatting

When you insert a CSS property, a colon is automatically added. When you type an opening brace ("{"), a closing brace ("}") is added.

Hierarchical indentation

Parent and child relationships are now indented in the editing pane so that the CSS hierarchy is clearer.

Hierarchical indentation (What's New whitepaper)

CSS Editor Hierarchical Indentation (video)

Auto-reducing statement completion

As you type, IntelliSense reduces the options that are displayed to only the ones that are appropriate. IntelliSense displays items that contain the string that you type regardless of whether the string occurs at the beginning, middle, or end of the matching item.

Auto-reduce statement completion (What's New whitepaper)

Comment/Uncomment

The keyboard shortcuts for commenting and uncommenting in the HTML editor (CTRL+K, CTRL+C, and CTRL+K, CTRL+U) are now available in the CSS editor. (When a partially selected commented block is uncommented, the whole block is uncommented.)

Commenting and uncommenting support (What's New whitepaper)

Color picker

When you type # or rgb( after any CSS property that takes a color value, a color picker is displayed that can insert the value for the color. The value is inserted in hexadecimal or other formats into the style sheet.

Color picker (What's New whitepaper)

CSS Editor Color Picker (video)

Snippets for vendor-specific extensions to CSS

Snippets facilitate the entry of vendor-specific extensions like -ms-, -moz-, and -webkit-.

Snippets (What's New whitepaper)

CSS Snippets (video)

Support for CSS hacks

Selector and property hacks like *color and _width are understood and validated.

CSS hacks support (What's New whitepaper)

Conformance with W3C standards

The Visual Studio 2012 CSS schema follows W3C standards. For a complete list of the CSS modules supported in Visual Studio 2012, see the resource link.

Supported CSS module list

Browser-specific support for individual elements

The Visual Studio 2012 CSS editor knows what version of a particular browser supports specific properties, directives, pseudo-classes, elements and values. Supported browsers include Chrome, Firefox, Internet Explorer, Opera and Safari.

What's New in ASP.NET 4.5 and Visual Studio 2012 (What's New whitepaper)

Vendor-specific prefixes in IntelliSense with tooltip help for each

Typing a hyphen in the CSS editor displays a list of all Mozilla, Internet Explorer, Opera, and WebKit vendor-specific prefixes. If you select a prefix in the list with the mouse pointer, a tooltip displays help text for the selected entry.

Visual Studio 2012 RC is released - The Big Web Rollup (Scott Hanselman blog)

Examples in tooltips

When you type a property name in the CSS editor, a tooltip displays a helpful example that shows how values should be assigned to the property.

What's New in ASP.NET 4.5 and Visual Studio 2012 (What's New whitepaper)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website and New CSS Editor Improvements in Visual Studio (ASP.NET 4.5 Series).

JavaScript Editor

The JavaScript editor in Visual Studio 2012 offers the following enhancements:

  • Support for ECMAScript5.

  • Numerous IntelliSense improvements.

  • Braces matching.

  • A "Go to Definition" feature that jumps from a variable or function name to its definition when you choose the F12 key.

For more information, see JavaScript Editor on the ASP.NET website.

The following table lists some of the data-related changes that have been made in Visual Studio 2012. For data-related enhancements that pertain to Web Forms, see the ??? ASP.NET Web Forms section in this document.

Feature

Description

Resources

SQL Server Express LocalDB as the default database

SQL Server Express LocalDB replaces SQL Server Express as the default database engine for development. SQL Server Express LocalDB is a lightweight version of SQL Server that has many of the programmability features of a SQL Server database.

Local Data Overview (MSDN Library)

SQL Server Object Explorer

A new SQL Server Object Explorer in Visual Studio lets you manage database objects in a way similar to SQL Server Management Studio. You can open the SQL Server Object Explorer from the View menu in Visual Studio.

Connected Database Development (MSDN Library)

Table Designer

A new Table Designer allows you to define a table by using a graphical designer, a script, or both. The script updates automatically as you change the table design in the graphical designer.

How to: Create Database Objects Using Table Designer (MSDN Library)

New DataAnnotations attributes

New attributes in the System.ComponentModel.DataAnnotations namespace automate validation for common data types such as email addresses, telephone numbers, and credit card numbers. Selected new attributes are listed in the Resources column.

CreditCardAttribute (MSDN Library)

EmailAddressAttribute (MSDN Library)

FileExtensionsAttribute (MSDN Library)

MaxLengthAttribute (MSDN Library)

MinLengthAttribute (MSDN Library)

PhoneAttribute (MSDN Library)

UrlAttribute (MSDN Library)

The Entity Framework and ASP.NET – Getting Started Part 8 (ASP.NET website)

Performing Validations (article)

Dynamic Data enhancements

Dynamic Data now supports Entity Framework enumerations and spatial data types.

Unobtrusive JavaScript for client-side validation

You can now configure DynamicField controls to generate unobtrusive JavaScript for client-side validation.

Unobtrusive Validation (What's New whitepaper)

For more information, see What's New for Data Application Development in Visual Studio 2012 and ASP.NET Data Access Content Map.

Web Application Project Deployment Enhancements

For an overview of the Visual Studio deployment enhancements see this video: Dirt Simple Web and Database Deployment in Visual Studio 11.

The following table lists some of the enhancements to the deployment tools for Visual Studio 2012. All of these enhancements can also be installed in Visual Studio 2010 or Visual Web Developer 2010 Express by visiting the following link: Visual Studio 2010 Web Publish Update.

Feature

Description

Resources

Import publish settings files from hosting providers

You can download a file from your hosting provider that contains the settings you need to publish your project, and you can import that file into Visual Studio so that you don't have to enter the values manually.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Link Web.config transformations to publish profiles

You can link Web.config transformation files to specific publish profiles, not just to build configurations. (For example, if you have a publish profile that's named "Staging", you can have a Web.config transformation file for it that's named "Web.Staging.config".) This makes deploying the same project to different environments easier.

Store encrypted credentials in publish profiles

Information tied to a publish profile is now stored in a separate .pubxml file for each profile, and by default passwords are stored in a .pubxml.user file that is not included in source control.

Publish Profiles section in What's New in ASP.NET 4.5 and Visual Studio 2012

Specify the build configuration in the publish profile

You can specify the build configuration that should be deployed for a publish profile in the publish profile itself.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Preview file and database changes before they are actually made on the destination server

The new preview feature enables you to see which files will be copied or deleted and what database changes will be applied to the database, and you can cancel before the changes are applied. In the case of file operations, you can selectively cancel updates or deletions of specific files.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Deploy incremental database updates

After a database is deployed and you make new changes to the database schema, when you redeploy the project Visual Studio can automatically determine what changes need to be applied to the database. If you are using Entity Framework Code First Migrations, Visual Studio can automatically configure Code First Migrations to update the database to the latest version when the application runs.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Additional publishing enhancements

- A cleaner and simpler publish user interface.

- The ability to run Entity Framework Code First migrations from the publish dialog.

- The ability to update connection strings in the Web.config file at publish time (including complex EF connection strings).

- Prompting for untrusted certificates during publish.

- Automatic conversion of Visual Studio 2010 publish profiles to Visual Studio 2012 format.

- The ability to publish from the command line using a publish profile. Example syntax follows.

   msbuild mywap.csproj /p:DeployOnBuild=true;PublishProfile=MyProfileName

Web Deployment Overview for Visual Studio and ASP.NET

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

For more information, see Web Deployment Content Map for Visual Studio and ASP.NET.

Multiversion Support

Visual Studio 2012 lets you work with projects that use different versions of the .NET Framework or different versions of Visual Studio. For more information, see Project Sharing Between Visual Studio 2010 and Visual Studio Express 2012 (Project Compatibility) in What's New in ASP.NET 4.5 and Visual Studio 2012 (ASP.NET website).

Enhancements to ASP.NET Multitargeting

ASP.NET 4.5 updates the multitargeting feature with improved filtering for features that are not available in the target version of the .NET Framework.

Working with ASP.NET Applications in Either Visual Studio 2010 SP1 or Visual Studio 2012

You can open and work with Visual Studio 2010 SP1 projects in Visual Studio 2012 and vice-versa, without converting the project to a different format. (This feature is sometimes referred to as round-tripping.)

IIS Express

In Visual Studio 2012, IIS Express replaces the ASP.NET Development Server as the default web server for testing within Visual Studio. (In Visual Studio 2010 SP1, IIS Express was available as an option that you had to explicitly configure as the test web server.) IIS Express is a lightweight, self-contained version of IIS that has been optimized for developers. It has all the core capabilities of IIS as well as additional features designed to ease website development and includes the following:

  • It does not run as a service or require administrator user rights in order to perform most tasks.

  • IIS Express works well with ASP.NET and PHP applications.

  • Multiple users of IIS Express can work independently on the same computer.

For more information, see IIS Express Overview.

Additional Resources

The following links provide more information and resources that can help you learn about new features in ASP.NET 4.5 and Visual Studio 2012.