2012 Net 4.5 PDF
2012 Net 4.5 PDF
Automatic renaming of matching tag when you rename an opening or closing tag Event handler generation Smart indent Auto-reduce statement completion JavaScript Editor Code outlining Brace matching Go to Definition ECMAScript5 support DOM IntelliSense VSDOC signature overloads Implicit references CSS Editor Auto-reduce statement completion Hierarchical indentation. CSS hacks support Vendor specific schemas (-moz-,-webkit) Commenting and uncommenting support Color picker Snippets Custom regions Page Inspector Publishing Publish profiles [Link] precompilation and merge IIS Express Disclaimer
The Stream reference returned by [Link] 4.5 from [Link] supports both synchronous and asynchronous read methods. The Stream object returned from GetBufferlessInputStream now implements both the BeginRead and EndRead methods. The asynchronous Stream methods let you asynchronously read the request entity in chunks, while [Link] releases the current thread between each iteration of an asynchronous read loop. [Link] 4.5 has also added a companion method for reading the request entity in a buffered way:[Link]. This new overload works like GetBufferlessInputStream, supporting both synchronous and asynchronous reads. However, as it reads, GetBufferedInputStream also copies the entity bytes into [Link] internal buffers so that downstream modules and handlers can still access the request entity. For example, if some upstream code in the pipeline has already read the request entity using GetBufferedInputStream, you can still use [Link] or [Link]. This lets you perform asynchronous processing on a request (for example, streaming a large file upload to a database), but still run .aspx pages and MVC [Link] controllers afterward.
Suppose that you want to perform asynchronous work within a method that returns a Task object. The following code example defines an asynchronous method that makes an asynchronous call to download the Microsoft home page. Notice the use of the async keyword in the method signature and the await call to DownloadStringTaskAsync. private async Task ScrapeHtmlPage(object caller, EventArgs e) { WebClient wc = new WebClient(); var result = await [Link]("[Link] // Do something with the result } That's all you have to write the .NET Framework will automatically handle unwinding the call stack while waiting for the download to complete, as well as automatically restoring the call stack after the download is done. Now suppose that you want to use this asynchronous method in an asynchronous [Link] HTTP module. [Link] 4.5 includes a helper method (EventHandlerTaskAsyncHelper) and a new delegate type (TaskEventHandler) that you can use to integrate task-based asynchronous methods with the older asynchronous programming model exposed by the [Link] HTTP pipeline. This example shows how: public void Init(HttpApplication context) { // Wrap the Task-based method so that it can be used with // the older async programming model. EventHandlerTaskAsyncHelper helper = new EventHandlerTaskAsyncHelper(ScrapeHtmlPage); // The helper object makes it easy to extract Begin/End methods out of // a method that returns a Task object. The [Link] pipeline calls the // Begin and End methods to start and complete calls on asynchronous // HTTP modules. [Link]( [Link], [Link]); }
public class MyAsyncHandler : HttpTaskAsyncHandler { // ... // [Link] automatically takes care of integrating the Task based override // with the [Link] pipeline. public override async Task ProcessRequestAsync(HttpContext context) { WebClient wc = new WebClient(); var result = await [Link]("[Link] // Do something with the result } }
The new behavior makes it easier for different application components to look at different pieces of request data without triggering request validation on other pieces.
AntiXSS Library
Due to the popularity of the Microsoft AntiXSS Library, [Link] 4.5 now incorporates core encoding routines from version 4.0 of that library. The encoding routines are implemented by the AntiXssEncoder type in the new [Link]. You can use the AntiXssEncoder type directly by calling any of the static encoding methods that are implemented in the type. However, the easiest approach for using the new anti-XSS routines is to configure an [Link] application to use the AntiXssEncoder class by default. To do this, add the following attribute to the [Link] file: <httpRuntime ... encoderType="[Link],[Link], Version=[Link], Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> When the encoderType attribute is set to use the AntiXssEncoder type, all output encoding in [Link] automatically uses the new encoding routines. These are the portions of the external AntiXSS library that have been incorporated into [Link] 4.5: HtmlEncode, HtmlFormUrlEncode, and HtmlAttributeEncode XmlAttributeEncode and XmlEncode UrlEncode and UrlPathEncode (new) CssEncode
WebSocketReceiveResult result = await [Link](buffer, [Link]); // If the socket is still open, echo the message back to the client if ([Link] == [Link]) { string userMessage = [Link]([Link], 0, [Link]); userMessage = "You sent: " + userMessage + " at " + [Link](); buffer = new ArraySegment<byte>([Link](userMessage)); // Asynchronously send a message to the client await [Link](buffer, [Link], true, [Link]); } else { break; } } } The support in .NET 4.5 for the await keyword and asynchronous task-based operations is a natural fit for writing WebSockets applications. The code example shows that a WebSockets request runs completely asynchronously inside [Link]. The application waits asynchronously for a message to be sent from a client by calling await [Link]. Similarly, you can send an asynchronous message to a client by calling await [Link]. In the browser, an application receives WebSockets messages through an onmessage function. To send a message from a browser, you call the send method of the WebSocket DOM type, as shown in this example: // Receive a string message from the server. [Link] = function(msg) { [Link]("serverData").innerHTML = [Link]; }; // Send a string message from the browser. [Link]([Link]("msgText")); In the future, we might release updates to this functionality that abstract away some of the low-level coding that is required in this release for WebSockets applications.
it to a global BundleCollection instance. In the default templates, bundle configuration is performed in a BundleConfig file. This default configuration creates bundles for all of the core scripts and css files used by the templates. Bundles are referenced from within views by using one of a couple possible helper methods. In order to support rendering different markup for a bundle when in debug vs. release mode, the ScriptBundle and StyleBundle classes have the helper method, Render. When in debug mode, Render will generate markup for each resource in the bundle. When in release mode, Render will generate a single markup element for the entire bundle. Toggling between debug and release mode can be accomplished by modifying the debug attribute of the compilation element in [Link] as shown below: <[Link]> <compilation targetframework="4.5" debug="true" /> ...</[Link]> Additionally, enabling or disabling optimization can be set directly via the [Link] property. [Link] = true; When files are bundled, they are first sorted alphabetically (the way they are displayed in Solution Explorer). They are then organized so that known libraries and their custom extensions (such as jQuery, MooTools, and Dojo) are loaded first. For example, the final order for the bundling of the Scripts folder as shown above will be: 1. [Link] 2. 3. 4. [Link] [Link] [Link]
CSS files are also sorted alphabetically and then reorganized so that [Link] and [Link] come before any other file. The final sorting of the bundling of the Styles folder shown above will be this: 1. 2. 3. 4. 5. 6. [Link] [Link] [Link] [Link] [Link] [Link]
Ideally, all websites should be active and in memory to assure quick response to the next request, whenever it comes. Factors that can affect site responsiveness include: The time it takes for a site to restart after an app pool recycles. This is the time it takes to launch a web server process for the site when the site assemblies are no longer in memory. (The platform assemblies are still in memory, since they are used by other sites.) This situation is referred to as "cold site, warm framework startup" or just "cold site startup." How much memory the site occupies. Terms for this are "per-site memory consumption" or "unshared working set."
Performance increases with each level of improvement that you are able to enable. Some of the .NET Framework 4.5 improvements take advantage of broader performance features that apply to other scenarios as well.
aspnet_intern -mode exec -sourcedir "C:\Windows\[Link]\Framework\v4.0.30319\Temporary [Link] Files" -interndir C:\ASPNETCommonAssemblies To see all options, run the tool with no arguments.
/>
/>
(If you're familiar with the previous guidance for changes to [Link], note that this setting replaces the old settings for example, there is no need to set gcServer, gcConcurrent, etc. You do not have to remove the old settings.)
<asp:FormView runat="server" ID="editCustomer"> <EditItemTemplate> <div> <asp:Label runat="server" AssociatedControlID="firstName"> First Name:</asp:Label> <asp:TextBox ID="firstName" runat="server" Text='<%#Bind("FirstName") %>' /> </div> <div> <asp:Label runat="server" AssociatedControlID="lastName"> First Name:</asp:Label> <asp:TextBox ID="lastName" runat="server" Text='<%# Bind("LastName") %>' /> </div> <asp:Button runat="server" CommandName="Update"/> </EditItemTemplate> </asp:FormView> At run time, these calls use reflection to read the value of the specified member and then display the result in the markup. This approach makes it easy to data bind against arbitrary, unshaped data. However, data-binding expressions like this don't support features like IntelliSense for member names, navigation (like Go To Definition), or compile-time checking for these names. To address this issue, [Link] 4.5 adds the ability to declare the data type of the data that a control is bound to. You do this using the new ItemType property. When you set this property, two new typed variables are available in the scope of data-binding expressions: Item and BindItem. Because the variables are strongly typed, you get the full benefits of the Visual Studio development experience. For two-way data-binding expressions, use the BindItem variable: <asp:FormView runat="server" ID="editCustomer"> <EditItemTemplate> <div> <asp:Label runat="server" AssociatedControlID="firstName"> First Name:</asp:Label> <asp:TextBox ID="firstName" runat="server" Text='<%#[Link] %>' /> </div> <div> <asp:Label runat="server" AssociatedControlID="lastName"> First Name:</asp:Label> <asp:TextBox ID="lastName" runat="server" Text='<%#[Link] %>' /> </div> <asp:Button runat="server" CommandName="Update"/> </EditItemTemplate> </asp:FormView>
Most controls in the [Link] Web Forms framework that support data binding have been updated to support theItemType property.
Model Binding
Model binding extends data binding in [Link] Web Forms controls to work with code-focused data access. It incorporates concepts from the ObjectDataSource control and from model binding in [Link] MVC.
Selecting data
To configure a data control to use model binding to select data, you set the control's SelectMethod property to the name of a method in the page's code. The data control calls the method at the appropriate time in the page life cycle and automatically binds the returned data. There's no need to explicitly call the DataBind method. In the following example, the GridView control is configured to use a method named GetCategories: <asp:GridView ID="categoriesGrid" runat="server" ItemType="[Link]" SelectMethod="GetCategories" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="ID" /> <asp:BoundField DataField="CategoryName" HeaderText="Name" /> <asp:BoundField DataField="Description" HeaderText="Description" /> <asp:TemplateField HeaderText="# of Products"> <ItemTemplate><%# [Link] %></ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> You create the GetCategories method in the page's code. For a simple select operation, the method needs no parameters and should return an IEnumerable or IQueryable object. If the new ItemType property is set (which enables strongly typed data-binding expressions, as explained under Strongly Typed Data Controls earlier), the generic versions of these interfaces should be returned IEnumerable<T> or IQueryable<T>, with the T parameter matching the type of the ItemType property (for example, IQueryable<Category>). The following example shows the code for a GetCategories method. This example uses the Entity Framework Code First model with the Northwind sample database. The code makes sure that the query returns details of the related products for each category by way of the Include method. (This ensures that the TemplateField element in the markup displays the count of products in each category without requiring an n+1 select.) public IQueryable<Category> GetCategories() { var db = new Northwind(); return [Link](c => [Link]); }
When the page runs, the GridView control calls the GetCategories method automatically and renders the returned data using the configured fields:
Because the select method returns an IQueryable object, the GridView control can further manipulate the query before executing it. For example, the GridView control can add query expressions for sorting and paging to the returned IQueryable object before it is executed, so that those operations are performed by the underlying LINQ provider. In this case, Entity Framework will ensure those operations are performed in the database. The following example shows the GridView control modified to allow sorting and paging: <asp:GridView ID="categoriesGrid" runat="server" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true" PageSize="5" ItemType="[Link]" DataKeyNames="CategoryID" SelectMethod="GetCategories" UpdateMethod="UpdateCategory"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="ID" SortExpression="CategoryID" /> <asp:BoundField DataField="CategoryName" HeaderText="Name" SortExpression="CategoryName" /> <asp:BoundField DataField="Description" HeaderText="Description" /> <asp:TemplateField HeaderText="# of Products"> <ItemTemplate><%# [Link] %></ItemTemplate> </asp:TemplateField> </Columns> <EmptyDataTemplate>No categories found with a product count of <%# [Link] %></EmptyDataTemplate> </asp:GridView> Now when the page runs, the control can make sure that only the current page of data is displayed and that its ordered by the selected column:
To filter the returned data, parameters have to be added to the select method. These parameters will be populated by the model binding at run time, and you can use them to alter the query before returning the data. For example, assume that you want to let users filter products by entering a keyword in the query string. You can add a parameter to the method and update the code to use the parameter value: public IQueryable<Product> GetProducts(string keyword) { IQueryable<Product> query = _db.Products; if () { query = [Link](p => [Link](keyword)); } return query; } This code includes a Where expression if a value is provided for keyword and then returns the query results.
Value providers
The previous example was not specific about where the value for the keyword parameter was coming from. To indicate this information, you can use a parameter attribute. For this example, you can use the QueryStringAttributeclass thats in the [Link] namespace: public IQueryable<Product> GetProducts([QueryString]string keyword) { IQueryable<Product> query = _db.Products; if () { query = [Link](p => [Link](keyword)); } return query; }
This instructs model binding to try to bind a value from the query string to the keyword parameter at run time. (This might involve performing type conversion, although it doesn't in this case.) If a value cannot be provided and the type is non-nullable, an exception is thrown. The sources of values for these methods are referred to as value providers, and the parameter attributes that indicate which value provider to use are referred to as value provider attributes. Web Forms will include value providers and corresponding attributes for all of the typical sources of user input in a Web Forms application, such as the query string, cookies, form values, controls, view state, session state, and profile properties. You can also write custom value providers. By default, the parameter name is used as the key to find a value in the value provider collection. In the example, the code will look for a query-string value named keyword (for example, ~/[Link]?keyword=chef). You can specify a custom key by passing it as an argument to the parameter attribute. For example, to use the value of the query-string variable named q, you could do this: public IQueryable<Product> GetProducts([QueryString("q")]string keyword) { IQueryable<Product> query = _db.Products; if () { query = [Link](p => [Link](keyword)); } return query; } If this method is in the page's code, users can filter the results by passing a keyword using the query string:
Model binding accomplishes many tasks that you would otherwise have to code by hand: reading the value, checking for a null value, attempting to convert it to the appropriate type, checking whether the
conversion was successful, and finally, using the value in the query. Model binding results in far less code and in the ability to reuse the functionality throughout your application.
public IQueryable<Product> GetProducts( [QueryString("q")] string keyword, [Control("categories")] int? categoryId) { IQueryable<Product> query = _db.Products; if () { query = [Link](p => [Link](keyword)); } if ([Link] && categoryId > 0) { query = [Link](p => [Link] == categoryId); } return query; } Now when the page runs, users can select a category from the drop-down list, and the GridView control is automatically re-bound to show the filtered data. This is possible because model binding tracks the values of parameters for select methods and detects whether any parameter value has changed after a postback. If so, model binding forces the associated data control to re-bind to the data.
Unobtrusive Validation
You can now configure the built-in validator controls to use unobtrusive JavaScript for client-side validation logic. This significantly reduces the amount of JavaScript rendered inline in the page markup and reduces the overall page size. You can configure unobtrusive JavaScript for validator controls in any of these ways:
Globally by adding the following setting to the <appSettings> element in the [Link] file:
<add name="ValidationSettings:UnobtrusiveValidationMode" value="WebForms" />
Globally by setting the static [Link] property [Link] (typically in the Application_Start method in the [Link] file). Individually for a page by setting the new UnobtrusiveValidationMode property of the Page class [Link].
HTML5 Updates
Some improvements have been made to Web Forms server controls to take advantage of new features of HTML5: The TextMode property of the TextBox control has been updated to support the new HTML5 input types likeemail, datetime, and so on. The FileUpload control now supports multiple file uploads from browsers that support this HTML5 feature. Validator controls now support validating HTML5 input elements. New HTML5 elements that have attributes that represent a URL now support runat="server". As a result, you can use [Link] conventions in URL paths, like the ~ operator to represent the application root (for example, <video runat="server" src="~/[Link]" />). The UpdatePanel control has been fixed to support posting HTML5 input fields.
[Link] MVC 4
[Link] MVC 4 Beta is now included with Visual Studio 11 Beta. [Link] MVC is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. [Link] MVC 4 makes it easy to build applications for the mobile Web and includes [Link] Web API, which helps you build HTTP services that can reach any device. For more information, see the [Link] MVC 4 Release Notes.
New features include the following: New and updated site templates. Adding server-side and client-side validation using the Validation helper. The ability to register scripts using an assets manager. Enabling logins from Facebook and other sites using OAuth and OpenID. Adding maps using the Maps helper. Running Web Pages applications side-by-side. Rendering pages for mobile devices.
For more information about these features and full-page code examples, see The Top Features in Web Pages 2 Beta.
Project Sharing Between Visual Studio 2010 and Visual Studio 2012 Release Candidate (Project Compatibility)
Until Visual Studio 2012 Release Candidate, opening an existing project in a newer version of Visual Studio launched the Conversion Wizard. This forced an upgrade of the content (assets) of a project and solution to new formats that were not backward compatible. Therefore, after the conversion you could not open the project in the older version of Visual Studio. Many customers have told us that this was not the right approach. In Visual Studio 11 Beta, we now support sharing projects and solutions with Visual Studio 2010 SP1. This means that if you open a 2010 project in Visual Studio 2012 Release Candidate, you will still be able to open the project in Visual Studio 2010 SP1. Note: A few types of projects cannot be shared between Visual Studio 2010 SP1 and Visual Studio 2012 Release Candidate. These include some older projects (such as [Link] MVC 2 projects) or projects for special purposes (such as Setup projects). When you open a Visual Studio 2010 SP1 Web project for the first time in Visual Studio 11 Beta, the following properties are added to the project file: FileUpgradeFlags UpgradeBackupLocation OldToolsVersion VisualStudioVersion VSToolsPath
FileUpgradeFlags, UpgradeBackupLocation, and OldToolsVersion are used by the process that upgrades the project file. They have no impact on working with the project in Visual Studio 2010. VisualStudioVersion is a new property used by MSBuild 4.5 that indicates the version of Visual Studio for the current project. Because this property didnt exist in MSBuild 4.0 (the version of MSBuild that Visual Studio 2010 SP1 uses), we inject a default value into the project file. The VSToolsPath property is used to determine the correct .targets file to import from the path represented by the MSBuildExtensionsPath32 setting. There are also some changes related to Import elements. These changes are required in order to support compatibility between both versions of Visual Studio. Note: If a project is being shared between Visual Studio 2010 SP1 and Visual Studio 11 Beta on two different computers, and if the project includes a local database in the App_Data folder, you must make sure that the version of SQL Server used by the database is installed on both computers.
</modules> </[Link]> </configuration> When runAllManagedModulesForAllRequests is true, a URL like [Link] goes to [Link], even though there is no .aspx, .mvc, or similar extension on the URL. An update that was made to IIS 7 makes the runAllManagedModulesForAllRequests setting unnecessary and supports [Link] routing natively. (For information about the update, see the Microsoft Support article An update is available that enables certain IIS 7.0 or IIS 7.5 handlers to handle requests whose URLs do not end with a period.) If your website is running on IIS 7 and if IIS has been updated, you do not need to setrunAllManagedModulesForAllRequests to true. In fact, setting it to true is not recommended, because it adds unnecessary processing overhead to request. When this setting is true, all requests, including those for .htm, .jpg, and other static files, also go through the [Link] request pipeline. If you create a new [Link] 4.5 website using the templates that are provided in Visual Studio 2012 RC, the configuration for the website does not include the runAllManagedModulesForAllRequests setting. This means that by default the setting is false. If you then run the website on Windows 7 without SP1 installed, IIS 7 will not include the required update. As a consequence, routing will not work and you will see errors. If you have a problem where routing does not work, you can do either the following: Update Windows 7 to SP1, which will add the update to IIS 7. Install the update that's described in the Microsoft Support article listed previously. Set runAllManagedModulesForAllRequests to true in that website's [Link] file. Note that this will add some overhead to requests.
HTML Editor
Smart Tasks
In Design view, complex properties of server controls often have associated dialog boxes and wizards to make it easy to set them. For example, you can use a special dialog box to add a data source to a Repeater control or add columns to a GridView control. However, this type of UI help for complex properties has not been available in Source view. Therefore, Visual Studio 11 introduces Smart Tasks for Source view. Smart Tasks are context-aware shortcuts for commonly used features in the C# and Visual Basic editors. For [Link] Web Forms controls, Smart Tasks appear on server tags as a small glyph when the insertion point is inside the element:
The Smart Task expands when you click the glyph or press CTRL+. (dot), just as in the code editors. It then displays shortcuts that are similar to the Smart Tasks in Design view.
For example, the Smart Task in the previous illustration shows the GridView Tasks options. If you choose Edit Columns, the following dialog box is displayed:
Filling in the dialog box sets the same properties you can set in Design view. When you click OK, the markup for the control is updated with the new settings:
WAI-ARIA support
Writing accessible websites is becoming increasingly important. The WAI-ARIA accessibility standard defines how developers should write accessible websites. This standard is now fully supported in Visual Studio. For example, the role attribute now has full IntelliSense:
The WAI-ARIA standard also introduces attributes that are prefixed with aria- that let you add semantics to an HTML5 document. Visual Studio also fully supports these aria- attributes:
To invoke the snippet, press Tab twice when the element is selected in IntelliSense:
Automatic renaming of matching tag when you rename an opening or closing tag
If you rename an HTML element (for example, you change a div tag to be a header tag), the corresponding opening or closing tag also changes in real time.
This helps avoid the error where you forget to change a closing tag or change the wrong one.
By default, the event handler will use the control's ID for the name of the event-handling method:
The resulting event handler will look like this (in this case, in C#):
Smart indent
When you press Enter while inside an empty HTML element, the editor will put the insertion point in the right place:
If you press Enter in this location, the closing tag is moved down and indented to match the opening tag. The insertion point is also indented:
IntelliSense also filters based on the title case of the individual words in the IntelliSense list. For example, if you type "dl", both dl and asp:DataList are displayed:
This feature makes it faster to get statement completion for known elements.
JavaScript Editor
The JavaScript editor in Visual Studio 2012 Release Candidate is completely new and it greatly improves the experience of working with JavaScript in Visual Studio.
Code outlining
Outlining regions are now automatically created for all functions, allowing you to collapse parts of the file that arent pertinent to your current focus.
Brace matching
When you put the insertion point on an opening or closing brace, the editor highlights the matching one.
Go to Definition
The Go to Definition command lets you jump to the source for a function or variable.
ECMAScript5 support
The editor supports the new syntax and APIs in ECMAScript5, the latest version of the standard that describes the JavaScript language.
DOM IntelliSense
IntelliSense for DOM APIs has been improved, with support for many new HTML5 APIs including querySelector, DOM Storage, cross-document messaging, and canvas. DOM IntelliSense is now driven by a single simple JavaScript file, rather than by a native type library definition. This makes it easy to extend or replace.
Implicit references
You can now add JavaScript files to a central list that will be implicitly included in the list of files that any given JavaScript file or block references, meaning youll get IntelliSense for its contents. For example, you can add jQuery files to the central list of files, and youll get IntelliSense for jQuery functions in any JavaScript block of file, whether youve referenced it explicitly (using /// <reference />) or not.
CSS Editor
Auto-reduce statement completion
The IntelliSense list for CSS now filters based on the CSS properties and values supported by the selected schema.
Hierarchical indentation
The CSS editor uses indentation to display hierarchical rules, which gives you an overview of how the cascading rules are logically organized. In the following example, the #list a selector is a cascading child of list and is therefore indented.
The indentation of a rule is determined by its parent rules. Hierarchical indentation is enabled by default, but you can disable it the Options dialog box (Tools, Options from the menu bar):
Typical selector hacks are also supported so that hierarchical indentation is maintained even when they are applied. A typical selector hack used to target Internet Explorer 7 is to prepend a selector with *:firstchild + html. Using that rule will maintain the hierarchical indentation:
Color picker
In previous versions of Visual Studio, IntelliSense for color-related attributes consisted of a drop-down list of named color values. That list has been replaced by a full-featured color picker. When you enter a color value, the color picker is displayed automatically and presents a list of previously used colors followed by a default color palette. You can select a color using the mouse or the keyboard.
The list can be expanded into a complete color picker. The picker lets you control the alpha channel by automatically converting any color into RGBA when you move the opacity slider:
Snippets
Snippets in the CSS editor make it easier and faster to create cross-browser styles. Many CSS3 properties that require browser-specific settings have now been rolled into snippets.
CSS snippets support advanced scenarios (like CSS3 media queries) by typing the at-symbol (@), which shows the IntelliSense list.
When you select @media value and press Tab, the CSS editor inserts the following snippet:
As with snippets for code, you can create your own CSS snippets.
Custom regions
Named code regions, which are already available in the code editor, are now available for CSS editing. This lets you easily group related style blocks.
Page Inspector
Page Inspector is a tool that renders a web page (HTML, Web Forms, [Link] MVC, or Web Pages) in the Visual Studio IDE and lets you examine both the source code and the resulting output. For [Link] pages, Page Inspector lets you determine which server-side code has produced the HTML markup that is rendered to the browser.
For more information about Page Inspector, see the Page Inspector Release Notes.
Publishing
Publish profiles
In Visual Studio 2010, publishing information for Web application projects is not stored in version control and is not designed for sharing with others. In Visual Studio 2012 Release Candidate, the format of the publish profile has been changed. It has been made a team artifact, and it is now easy to leverage from builds based on MSBuild. Build configuration information is in the Publish dialog box so that you can easily switch build configurations before publishing. Publish profiles are stored in the PublishProfiles folder. The location of the folder depends on what programming language you are using:
[Link] [Link] /t:WebPublish /p:PublishProfile=ProfileName The [Link] value is the path of the project, and ProfileName is the name of the profile to publish. Alternatively, instead of passing the profile name for the PublishProfile property, you can pass in the full path to the publish profile.
When this option is selected, Visual Studio precompiles the application whenever you publish or package the web application. If you want to control how the site is precompiled or how assemblies are merged, click the Advanced button to configure those options.
IIS Express
The default web server for testing web projects in Visual Studio is now IIS Express. The Visual Studio Development Server is still an option for local web server during development, but IIS Express is now the recommended server. The experience of using IIS Express in Visual Studio 11 Beta is very similar to using it in Visual Studio 2010 SP1.
Disclaimer
This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein. The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred. 2012 Microsoft Corporation. All rights reserved. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
By Microsoft [Link] Team, [Link] is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.