Chapter 56
objects. More significant, a large number of String objects were collected from Generation 1, Generation 2, and the Large Object Heap (the third, fourth, and fifth columns from the left, respectively). This is a good indicator that these objects are not being collected as frequently as they should be.
Figure 56-17
From the snippet of code for which you were running the performance analysis, you can see that in each iteration of the loop, a new String was being created. The performance analysis indicates that not only are some very large String objects being allocated, the Garbage Collector is not collecting them in a timely manner. Examining the code a little more closely, you can see why: The length of the String is dependent on the loop index, which grows considerably. Most likely, this was supposed to be some other variable. Using the performance analysis, you have located the performance issue.
Build Automation
Although Visual Studio has always provided a rich environment in which developers can write and build applications, it has lacked the capability to automate building and testing applications. Building applications could be done manually by calling Visual Studio from the command line, or in a batch file, but this was tedious to set up. Team System includes a feature called Team Build, which provides a rich user interface to the new build engine, MSBuild, that has been released in conjunction with Visual Studio. As discussed in Chapter 7, project files are now build configuration files because they determine what MSBuild should do when an application is built. However, Team Build also enables development teams to define build types, which may include a number of projects, tests, and activities, and to schedule these to be run on remote computers.
In Figure 56-1 you saw the project structure within the Team Explorer window. At the bottom of this structure is a node entitled Team Builds, which contains all the build types for a project. To take advantage of being able to run builds on a remote computer and track build progress and status, you need to define a build type by selecting New Team Build Type from the right-click context menu for the Team Builds node.
The process of creating a build type requires a number of parameters, such as a name and description for the build, which solutions are to be built (any that are in the source control branch for the Team Project), and which configuration to use when building the selected solutions. The last two pages of the wizard are used to define which machine should be used to build the solutions, where any outputs are to be dropped, and whether to run any test cases or code analysis as part of the build. Figure 56-18 shows
the Creation Wizard dialog, where the build machine and drop location are defined.