[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
This page lists the new and enhanced features available in Visual Basic in Visual Studio 2012 RC.
For information about integrated development environment (IDE) features relevant for Visual Basic developers creating Windows 8 Release Preview applications, see Develop Metro style apps using Visual Studio 2012 RC.
The new Async feature provides an elegantly simple technique to make code asynchronous. This feature makes asynchronous programming almost as straightforward as synchronous programming.
When your user interface is unresponsive or your server does not scale, it is likely that you need your code to be more asynchronous. Writing asynchronous code has traditionally involved installing a callback (also called continuation) to express the logic that occurs after the asynchronous operation finishes. This complicates the structure of asynchronous code as compared with synchronous code.
With the Async feature, you can now call into asynchronous methods without using callbacks, and without splitting your code across multiple methods or lambda expressions.
The Async modifier specifies that a method is asynchronous. When calling an Async method, a task is returned. When calling an Await statement against the task, the current method exits immediately. When the task finishes, execution resumes in the same method.
Calling an Async method does not allocate any additional threads. It may use the existing I/O completion thread briefly at the end.
For more information, see Asynchronous Programming with Async and Await (C# and Visual Basic).
Iterators are used to perform custom iteration over collections such as lists or arrays.
An iterator uses the Yield statement to return each element in the collection one at a time. When a Yield statement is reached, the current location in code is retained. Execution is restarted from that location the next time that the iterator function is called.
You call an iterator from client code by using a For Each…Next statement.
Iterators were introduced in C# in Visual Studio 2005.
For more information, see Iterators (C# and Visual Basic).
Call Hierarchy enables you to navigate through your code by displaying the following:
-
All calls to and from a selected method, property, or constructor.
-
All implementations of an interface member.
-
All overrides of a virtual or abstract member.
Call Hierarchy enables you to better understand how code flows and to evaluate the effects of changes to code.
Call Hierarchy was introduced in C# in Visual Studio 2010.
For more information, see Call Hierarchy.
This version of Visual Basic introduces a feature that makes it easy to obtain information about the caller of a method. By using Caller Info attributes, you can identify the file path of the source code, the line number in the source code, and the member name of the caller. This information is helpful for tracing, debugging, and creating diagnostic tools.
For more information, see Caller Information (C# and Visual Basic).
You can now use the Global keyword in a Namespace statement. This lets you define a namespace out of the root namespace of your project.
For more information, see Namespaces in Visual Basic.