July 2015
Intermediate to advanced
1300 pages
87h 27m
English
One great feature in the code editor that Visual Studio 2015 inherits from its predecessors is the ability to generate on-the-fly objects that do not exist yet. This feature is known as Generate from Usage, and now it is integrated within light bulbs and quick actions, described in Chapter 6, “Errors, Exceptions, and Code Refactoring.” To understand how it works, create a new Console application named GenerateFromUsage and, within the Main method, type the following code:
Sub Main() Dim p As New PersonEnd Sub
Because the Person class has not been implemented, the Visual Basic compiler throws an exception, but if you enable the light bulb, it will suggest possible solutions, as shown in Figure 17.11 ...