Visual Studio 2010
Now that we've seen the hardcore way of building applications using plain old text editors and the C# command-line compiler, it's time to get more realistic by having a look at professional tooling support provided by the Visual Studio 2010 products. Figure 3.15 shows the new Visual Studio 2010 logo, reflecting the infinite possibilities of the technology.
Figure 3.15 The Visual Studio 2010 logo.
Since the very beginning of software development on the Microsoft platform, Visual Studio has been an invaluable tool to simplify everyday development tasks significantly. One core reason for this is its integrated development environment (IDE) concept, which is really an expansive term with an overloaded meaning today. Although it originally stood for the combination of source code editing and debugging support, today's IDE has capabilities that stretch a whole range of features such as
- Source code editing with built-in language support for various languages such as C#, Visual Basic, F# and C++, including things such as syntax coloring, IntelliSense autocompletion, and so on.
- Refactoring support is one of the powerful tools that makes manipulating code easier and allows for the restructuring of existing code with just a few clicks in a (mostly) risk-free manner.
- Exploring code is what developers do most of their time in the editors. Navigating between source files is just the tip of the iceberg, with the editor providing means to navigate to specific types and members.
- Visualization of project structures bridges the gap between architecture, design, and implementation of software. In the spirit of UML, class designers and architecture explorers are available right inside the tool.
- Designers come into play when code is to be generated for common tasks that benefit from a visual development approach. Typical examples include GUI design, web page layout, object/relational mappings, workflow diagrams, and so on.
- Debugging facilities are the bread and butter for every developer to tame the complexities of analyzing code behavior and (hopefully not too many) bugs by stepping through code and analyzing the state of execution.
- Project management keeps track of the various items that are part of a software development project, including source files, designer-generated files, project-level settings, and so on.
- Integrated build support is tightly integrated with project management features and allows immediate invocation of the build process to produce executable code and feed build errors and warnings back to the IDE.
- Source control and work item tracking are enterprise-level features for managing large-scale collaborative software development projects, providing means to check in/out code, open and close bugs, and so on.
- Extensibility might not be not the most visible feature of the IDE but provides a huge opportunity for third parties to provide extensions for nearly every aspect of the tooling support.
Editions
I feel like a marketing guy saying so, but to "differentiate between the needs for various software development groups," Visual Studio 2010 is available in different editions. Here's an overview:
- Visual Studio Express Editions are targeted at hobbyist developers and students, providing a great way to get rich tooling support to explore the .NET platform and various languages. Individual downloads for Visual C#, Visual Basic, Visual C++, and Visual Web Developer (targeting ASP.NET website development) can be found at www.microsoft.com/express. Notice there's also an Express Edition of SQL Server 2008 R2, giving access to a superb relational database engine (with a couple of enforced restrictions). To complete the family, a new Windows Phone 7 Express toolkit was added recently.
- Visual Studio Standard Edition is the entry-level edition for individual developers and small teams, with all the essentials for rich application development on the .NET platform, using any of the available programming languages. It has rich debugger support and project templates for Windows and web applications, but it lacks features like unit testing.
- Visual Studio Professional Edition is aimed at the professional developer, giving access to the various languages in the same package. It has rich tooling capabilities that stretch beyond those of the Standard Edition, including unit testing, support for Visual Studio Tools for Office (VSTO) to extend the Office products using managed code, mobile device development, SQL database project templates, and various types of application deployment projects.
- Visual Studio Ultimate Edition is the collective name for the largest editions available, targeting large-scale team development. Different flavors exist, targeting various roles within a development organization, such as developers, testers, architects, and database professionals. Unique features include source control integration, rich performance analysis tools, quality metric tools, and so on. On the server side, there's Team Foundation Server (TFS), which provides the necessary infrastructure for work item tracking, source control, document libraries, project metrics reporting, and so on.
In this book, we mainly focus on language- and framework-level aspects of programming on the .NET platform, which are separate from the tooling support. However, when covering tooling support, we assume the reader has access to at least the Professional Edition of Visual Studio 2010. This said, lots of the features covered (such as debugging support to name an essential one) are available in the Express Edition, too. From time to time, we'll have a peek at Team System-level features, as well, but in a rather limited fashion.
Oh, and by the way, Visual Studio is available in different (natural) languages beyond just English. However, this book refers to the English vocabulary used in menus, dialogs, and so on.
Expression
Applications with GUIs, either for Windows or the Web, are typically not just built by development teams. An important peer to the developer involved in GUI development is a professional designer working on the look and feel for the application's user experience.
Platform-level technologies like Windows Presentation Foundation (WPF), Silverlight, and ASP.NET are built with this fact in mind, allowing for rich styling capabilities and a separation between developer code and UI definitions (for example, in terms of XAML). This is a very powerful concept that enables developers and designers to work in parallel with one another.
Although this book focuses on the developer aspect of .NET application development, it's important to know about the Expression family of tools that can be used by your designer peers. More information about those tools can be found at www.microsoft.com/expression.
Installing Visual Studio 2010
Installation of Visual Studio 2010 should be straightforward. Assuming you are using at least the Professional Edition of the product, check boxes will appear to install managed code/native code development support (see Figure 3.16). Make sure to check the managed code option or switch the options page to the more verbose mode where individual features can be turned on or off.
Figure 3.16 Visual Studio 2010 Ultimate installation options.
Depending on the number of features you select (I typically do a full installation to avoid DVD or other install media hunts afterward), installation might take a while. If you don't already have those installed, various prerequisites, such as the .NET Framework, will get installed as well, potentially requiring a reboot or two. But it's more than worth the wait.
Once Visual Studio setup has completed, make sure to install the product documentation, also known as the Help Library. Although the Visual Studio help system can hook up to the online version of MSDN seamlessly, it's convenient to have the documentation installed locally if you can afford the disk space. To do so, go to the Start Menu and find the Manage Help Settings entry under the Visual Studio 2010, Visual Studio Tools folder. Figure 3.17 shows the user interface of this tool, where one can install content from the installation disk or by downloading it.
Figure 3.17 MSDN Library installation option.
A Quick Tour Through Visual Studio 2010
With Visual Studio 2010 installed, let's take a quick tour through the IDE you'll be spending a lot of your time as a developer in.
What Got Installed
Depending on the edition you have installed, a number of tools will have been installed in parallel with the Visual Studio 2010 editor itself. Figure 3.18 shows the Start menu entry for Visual Studio 2010 for an Ultimate Edition installation on a 64-bit machine. A few notable entries here are as follows:
- Visual Studio 2010 Command Prompt provides a command prompt window with several environment variables set, including additions to the search path to locate various tools such as the command-line compilers.
- Visual Studio 2010 Remote Debugger is one of my favorite tools when debugging services or other types of applications that run on a remote machine. It enables you to enable debugging applications over the network right from inside Visual Studio 2010.
Figure 3.18 Visual Studio 2010 Start menu entries.
Splash Screen and Start Page
The Visual Studio 2010 splash screen is shown in Figure 3.19. Prior to Visual Studio 2010, the splash screen used to show the different extensibility packages that were installed. Now this information is available from the Help, About menu.
Figure 3.19 Visual Studio 2010 splash screen.
New and notable packages in Visual Studio 2010 are the built-in Silverlight projects and out-of-the-box support for the F# language.
The first thing you'll see in Visual Studio is the Start page shown in Figure 3.20. It provides links to various tasks (for example, to reload recently used projects). An RSS feed shows news items from the MSDN website.
Figure 3.20 Visual Studio 2010 Start page.
Core UI Elements
The menu and toolbar contain a wealth of features. (We'll only cover the essential ones.) Make sure to explore the menu a bit for things that catch your eye. Because we haven't loaded a project yet, various toolbars are not visible yet.
Various collapsible panels are docked on the borders. There are several of those, but only a few are visible at this point: Toolbox, Solution Explorer, and Error List are the ones we'll interact with regularly. More panels can be enabled through the View menu, but most panels have a contextual nature and will appear spontaneously when invoking certain actions (for example, while debugging). Figure 3.21 shows how panels can be docked at various spots in the editor. The little pushpin button on the title bar of a panel can be used to prevent it from collapsing. As you get more familiar with the editor, you'll start rearranging things quite bit to adapt to your needs.
Figure 3.21 Customizing the look and feel by docking panels.