Contents

About the Authors

Guest Authors

Credits

Acknowledgments

Introduction

Part I: Integrated Development Environment

Chapter 1: A Quick Tour

Let’s Get Started

The Visual Studio IDE

Summary

Chapter 2: The Solution Explorer, Toolbox, and Properties

The Solution Explorer

The Toolbox

Properties

Summary

Chapter 3: Options and Customizations

Window Layout

The Editor Space

Other Options

Importing and Exporting Settings

Summary

Chapter 4: Workspace Control

Command Window

Immediate Window

Class View

Object Browser

Object Test Bench

Code View

Document Outline Tool Window

Control Outline

Summary

Chapter 5: Find and Replace, and Help

Introducing Find and Replace

Find in Files

Replace in Files

Incremental Search

Find Symbol

Find and Replace Options

Accessing Help

The Search Window

Keeping Favorites

Customizing Help

Summary

Part II: Getting Started

Chapter 6: Solutions, Projects, and Items

Solution Structure

Solution File Format

Solution Properties

Project Types

Project Files Format

Project Properties

Web Site Projects

Summary

Chapter 7: Source Control

Selecting a Source Control Repository

Accessing Source Control

Offline Support for Source Control

Summary

Chapter 8: Forms and Controls

The Windows Form

Form Design Preferences

Adding and Positioning Controls

Container Controls

Docking and Anchoring Controls

Summary

Chapter 9: Documentation Using Comments and Sandcastle

Inline Commenting

XML Comments

Using XML Comments

Sandcastle Documentation Generation Tools

Task List Comments

Summary

Chapter 10: Project and Item Templates

Creating Templates

Extending Templates

Summary

Part III: Languages

Chapter 11: Generics, Nullable Types, Partial Types, and Methods

Generics

Nullable Types

Partial Types

Operator Overloading

Property Accessibility

Custom Events

Summary

Chapter 12: Anonymous Types, Extension Methods, and Lambda Expressions

Object and Array Initialization

Implicit Typing

Anonymous Types

Extension Methods

Lambda Expressions

Summary

Chapter 13: Language-Specific Features

C#

VB.NET

Summary

Chapter 14: The My Namespace

What Is the My Namespace?

Using My in Code

A Namespace Overview

Your Turn

Summary

Chapter 15: The Languages Ecosystem

Hitting a Nail with the Right Hammer

Introducing F#

Summary

Part IV: Coding

Chapter 16: IntelliSense and Bookmarks

IntelliSense Explained

IntelliSense Options

Extended IntelliSense

Bookmarks and the Bookmark Window

Summary

Chapter 17: Code Snippets and Refactoring

Code Snippets Revealed

Accessing Refactoring Support

Refactoring Actions

Summary

Chapter 18: Modeling with the Class Designer

Creating a Class Diagram

Design Surface

Toolbox

Class Details

Properties Window

Layout

Exporting Diagrams

Code Generation and Refactoring

PowerToys for the Class Designer

Summary

Chapter 19: Server Explorer

The Servers Node

Summary

Chapter 20: Unit Testing

Your First Test Case

Asserting the Facts

Initializing and Cleaning Up

Testing Context

Advanced

Managing Large Numbers of Tests

Summary

Part V: Data

Chapter 21: DataSets and DataBinding

DataSet Overview

Binding

Object Data Source

Working with Data Sources

Summary

Chapter 22: Visual Database Tools

Database Windows in Visual Studio 2008

Managing Test Data

Previewing Data

Summary

Chapter 23: Language Integrated Queries (LINQ)

LINQ Providers

Old-School Queries

Query Pieces

Debugging and Execution

Summary

Chapter 24: LINQ to XML

XML Object Model

Creating XML with LINQ

Querying XML

Schema Support

Summary

Chapter 25: LINQ to SQL and Entities

LINQ to SQL

LINQ to Entities

Summary

Chapter 26: Synchronization Services

Occasionally Connected Applications

Summary

Part VI: Security

Chapter 27: Security in the .NET Framework

Key Security Concepts

Code Access Security

Role-Based Security

Summary

Chapter 28: Cryptography

General Principles

Techniques

Applying Cryptography

Miscellaneous

Summary

Chapter 29: Obfuscation

MSIL Disassembler

Decompilers

Obfuscating Your Code

Attributes

Summary

Chapter 30: Client Application Services

Client Services

Role Authorization

User Authentication

Settings

Login Form

Offline Support

Summary

Chapter 31: Device Security Manager

Security Configurations

Device Emulation

Summary

Part VII: Platforms

Chapter 32: ASP.NET Web Applications

Web Application vs. Web Site Projects

Creating Web Projects

Designing Web Forms

Web Controls

Master Pages

Rich Client-Side Development

ASP.NET Web Site Administration

Summary

Chapter 33: Office Applications

Choosing an Office Project Type

Creating a Document-Level Customization

Creating an Application Add-In

Debugging Office Applications

Deploying Office Applications

Summary

Chapter 34: Mobile Applications

Getting Started

The Design Skin

The Toolbox

Debugging

Project Settings

The Data Source

Windows Mobile APIs

Summary

Chapter 35: WPF Applications

Getting Started

WPF Designer

Styling Your Application

Windows Forms Interoperability

Summary

Chapter 36: WCF and WF Applications

Windows Communication Foundation

Windows Workflow Foundation

Summary

Chapter 37: Next Generation Web: Silverlight and ASP.NET MVC

Silverlight

ASP.NET MVC

Summary

Part VIII: Configuration and Internationalization

Chapter 38: Configuration Files

Config Files

Configuration Schema

Application Settings

Referenced Projects with Settings

Summary

Chapter 39: Connection Strings

Connection String Wizard

SQL Server Format

In-Code Construction

Encrypting Connection Strings

Summary

Chapter 40: Resource Files

What Are Resources?

Resourcing Your Application

Satellite Resources

Accessing Specifics

Coding Resource Files

Custom Resources

Summary

Part IX: Debugging

Chapter 41: Using the Debugging Windows

Code Window

Breakpoint Window

Output Window

Immediate Window

Watch Windows

Call Stack

Threads

Modules

Processes

Memory Windows

Exceptions

Summary

Chapter 42: Debugging with Breakpoints

Breakpoints

Tracepoints

Execution Point

Edit and Continue

Summary

Chapter 43: Creating Debug Proxies and Visualizers

Attributes

Type Proxies

Visualizers

Advanced Techniques

Summary

Chapter 44: Debugging Web Applications

Debugging Server-Side ASP.NET Code

Debugging Client-Side JavaScript

Debugging Silverlight

Tracing

Health Monitoring

Summary

Chapter 45: Advanced Debugging Techniques

Start Actions

Debugging with Code

Debugging Running Applications

.NET Framework Reference Source

Multi-Threaded Debugging

Debugging SQL Server Stored Procedures

Mixed-Mode Debugging

Summary

Part X: Build and Deployment

Chapter 46: Upgrading with Visual Studio 2008

Upgrading from Visual Studio 2005

Upgrading to .NET Framework v3.5

Upgrading from Visual Basic 6

Summary

Chapter 47: Build Customization

General Build Options

Manual Dependencies

Visual Basic Compile Page

C# Build Pages

MSBuild

Summary

Chapter 48: Assembly Versioning and Signing

Assembly Naming

Summary

Chapter 49: ClickOnce and MSI Deployment

Installers

ClickOnce

Summary

Chapter 50: Web and Mobile Application Deployment

Web Application Deployment

Mobile Application Deployment

Summary

Part XI: Automation

Chapter 51: The Automation Model

Introduction to the Automation Model

The Automation Model and Visual Studio Extensibility

Development Tools Extensibility (DTE)

A Quick Overview of DTE

Limitations of the Automation Model

Summary

Chapter 52: Add-Ins

Introduction

Add-In Wizard

The Anatomy of an Add-In

The Structure of .AddIn Files

Develop an Add-In

Debugging

Deployment

Shared Add-Ins

Summary

Chapter 53: Macros

The Anatomy of a Macro

Macro Explorer

Macros IDE

How to Record a Macro

How to Develop a Macro

Running a Macro

Deployment

Summary

Part XII: Visual Studio Team System

Chapter 54: VSTS: Architect Edition

Case Study

Application Designer

Logical Datacenter Designer

Deployment Designer

Settings and Constraints Editor

System Designer

Summary

Chapter 55: VSTS: Developer Edition

Code Metrics

Managed Code Analysis Tool

C/C++ Code Analysis Tool

Profiling Tools

Stand-Alone Profiler

Application Verifier

Code Coverage

Summary

Chapter 56: VSTS: Tester Edition

Web Tests

Load Tests

Manual Tests

Generic Tests

Ordered Tests

Test Management

Summary

Chapter 57: VSTS: Database Edition

SQL-CLR Database Project

Offline Database Schema

Data Generation

Database Unit Testing

Database Refactoring

Schema Compare

Data Compare

T-SQL Editor

Power Tools

Best Practices

Summary

Chapter 58: Team Foundation Server

Process Templates

Work Item Tracking

Excel and Project Integration

Version Control

Team Foundation Build

Reporting and Business Intelligence

Team Portal

Team System Web Access

TFS Automation and Process Customization

Summary

Index

Advertisement

Professional Visual Studio® 2008

Published by

Wiley Publishing, Inc.

10475 Crosspoint Boulevard

Indianapolis, IN 46256

www.wiley.com

Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana

ISBN: 978-0-470-229880

Library of Congress Cataloging-in-Publication Data is available from the publisher.

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Visual Studio is a registered trademark of Microsoft Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

About the Authors

Nick Randolph is currently the Chief Development Officer for N Squared Solutions, having recently left his role as lead developer at Intilecta Corporation where he was integrally involved in designing and building that firm’s application framework.

After graduating with a combined Engineering (Information Technology)/Commerce degree, Nick went on to be nominated as a Microsoft MVP in recognition of his work with the Perth .NET user group and his focus on mobile devices. He is still an active contributor in the device application development space via his blog at http://community.softteq.com/blogs/nick/ and via the Professional Visual Studio web site, http://www.professionalvisualstudio.com/.

Over the past two years, Nick has been invited to present at a variety of events including Tech Ed Australia, MEDC, and Code Camp. He has also authored articles for MSDN Magazine (ANZ edition) and a book entitled Professional Visual Studio 2005, and has helped judge the 2004, 2005, and 2007 world finals for the Imagine Cup.

David Gardner is a seasoned.NET developer and the Chief Software Architect at Intilecta Corporation. David has an ongoing passion to produce well-designed, high-quality software products that engage and delight users. For the past decade and a bit, David has worked as a solutions architect, consultant, and developer, and has provided expertise to organizations in Australia, New Zealand, and Malaysia.

David is a regular speaker at the Perth .NET user group, and has presented at events including the .NET Framework Launch, TechEd Malaysia, and the Microsoft Executive Summit. He holds a Bachelor of Science (Computer Science) and is a Microsoft Certified Systems Engineer.

David regularly blogs about Visual Studio and .NET at http://www.professionalvisualstudio.com/, and maintains a personal web site at http://peaksite.com/.

Guest Authors

Miguel Madero

Miguel Madero is a Senior Developer with Readify Consulting in Australia. Miguel has architected different frameworks and solutions for disconnected mobile applications, ASP.NET, and Distributed Systems, worked with Software Factories, and trained other developers in the latest Microsoft technologies. Miguel was also the founder of DotNetLaguna, the .NET User Group in Torreón, Coahuila, México. In his spare time Miguel enjoys being with his beautiful fiancée, Carina, practicing rollerblading, and trying to surf at Sydney’s beaches. You can find Miguel’s blog at http://www.miguelmadero.com/.

Miguel wrote Chapters 54 through 58 of this book, covering Visual Studio Team Suite and Team Foundation Server.

Keyvan Nayyeri

Keyvan Nayyeri is a software architect and developer with a Bachelor of Science degree in Applied Mathematics. Keyvan’s main focus is Microsoft development and related technologies. He has published articles on many well-known .NET online communities and is an active team leader and developer for several .NET open-source projects.

Keyvan is the author of Professional Visual Studio Extensibility and co-authored Professional Community Server, also published by Wrox Press. You can find his thoughts on .NET, Community Server and Technology at http://www.nayyeri.net/.

Keyvan was a guest author on this book, writing Chapters 51 through 53 on Visual Studio Automation.

Joel Pobar

Joel Pobar is a habituated software tinkerer originally from sunny Brisbane, Australia. Joel was a Program Manager on the .NET Common Language Runtime team, sharing his time between late-bound dynamic CLR features (Reflection, Code Generation), compiler teams, and the Shared Source CLI program (Rotor). These days, Joel is on sabbatical, exploring the machine learning and natural language processing worlds while consulting part-time for Microsoft Consulting Services. You can find Joel’s recent writings at http://callvirt.net/blog/.

Joel lent his expertise to this book by authoring Chapter 15 on the Languages Ecosystem.

Credits

Acquisitions Editor

Katie Mohr

Development Editor

William Bridges

Technical Editors

Todd Meister

Keyvan Nayyeri

Doug Holland

Production Editor

William A. Barton

Copy Editors

Kim Cofer

S.D. Kleinman

Editorial Manager

Mary Beth Wakefield

Production Manager

Tim Tate

Vice President and Executive Group Publisher

Richard Swadley

Vice President and Executive Publisher

Joseph B. Wikert

Project Coordinator, Cover

Lynsey Osborne

Proofreaders

David Fine, Corina Copp, Word One

Indexer

Robert Swanson

Acknowledgments

I was expecting that writing the second edition of this book would be relatively straightforward — a little tweak here and a bit extra there — but no, the reality was that it was again one of the most time-demanding exercises I’ve undertaken in recent years. I must thank my partner, Cynthia, who consistently encouraged me to “get it done,” so that we can once again have a life.

I would especially like to thank everyone at Wrox who has helped me re-learn the art of technical writing — in particular, Bill Bridges, whose attention to detail has resulted in consistency throughout the book despite there being five authors contributing to the process, and Katie Mohr (whose ability to get us back on track was a life-saver), who made the whole process possible.

I have to pass on a big thank you to my co-author, David Gardner, who agreed to work with me on the second edition of this book. I doubt that I really gave an accurate representation of exactly how much work would be involved, and I really appreciated having someone of such high caliber to bounce ideas off of and share the workload. As we approached the mid-point of this book, I really appreciated a number of guest authors stepping in to help ensure we were able to meet the deadline. So a big thanks to Keyvan Nayyeri, Miguel Madero, and Joel Pobar for their respective contributions.

Lastly, I would like to thank all of my fellow Australian MVP developers and the Microsoft staff (Dave Glover and Andrew Coates particularly), who were always able to answer any questions along the way.

— Nick Randolph

This book represents one of the most rewarding and challenging activities I’ve ever undertaken. Writing while maintaining a full-time job is certainly not for the fainthearted. However, in the process I have amassed a wealth of knowledge that I never would have found the time to learn otherwise.

The process of writing a book is very different from writing code, and I am especially thankful to the team at Wrox for helping guide me to the finish line. Without Katie Mohr and Bill Bridges working as hard as they did to cajole the next chapter out of us, we never would have gotten this finished. Katie put her trust in me as a first-time author, and fully supported our decisions regarding the content and structure of the book. Bill improved the clarity and quality of my writing and corrected my repeated grammatical transgressions and Aussie colloquialisms. It was a pleasure to be in such experienced hands, and I thank them both for their patience and professionalism.

A huge thank you goes to my co-author Nick Randolph, who invited me to join him in writing this book, and managed to get us organized early on when I had very little idea what I was doing. I enjoyed collaborating on such a big project and the ongoing conversations about the latest cool feature that we’d just discovered.

Much appreciation and thanks go to our guest authors, Keyvan Nayyeri, Miguel Madero, and Joel Pobar, whose excellent contributions to this book have improved it significantly. Also thanks to my fellow coffee drinkers and .NET developers, Mitch Wheat, Michael Minutillo, and Ola Karlsson, for their feedback and suggestions on how to improve various chapters.

Most of all I would like to thank my beautiful and supportive wife, Julie. She certainly didn’t know what she was getting herself into when I agreed to write this book, but had she known I’ve no doubt that she would still have been just as encouraging and supportive. Julie did more than her fair share for our family when I needed to drop almost everything else, and I am truly grateful for her love and friendship.

Finally, thanks to my daughters Jasmin and Emily, who gave up countless cuddles and tickles so that Daddy could find the time to write this book. I promise I’ll do my best to catch up on the tickles that I owe you, and pay them back with interest.

— David Gardner

Introduction

Visual Studio 2008 is an enormous product no matter which way you look at it. Incorporating the latest advances in Microsoft’s premier programming languages, Visual Basic and C#, along with a host of improvements and new features in the user interface, it can be intimidating to both newcomers and experienced .NET developers.

Professional Visual Studio 2008 looks at every major aspect of this developer tool, showing you how to harness each feature and offering advice about how best to utilize the various components effectively. It shows you the building blocks that make up Visual Studio 2008, breaking the user interface down into manageable chunks for you to understand.

It then expands on each of these components with additional details about exactly how it works both in isolation and in conjunction with other parts of Visual Studio to make your development efforts even more efficient.

Who This Book Is For

Professional Visual Studio 2008 is for all developers new to Visual Studio as well as those programmers who have some experience but want to learn about features they may have previously overlooked.

If you are familiar with the way previous versions of Visual Studio worked, you may want to skip Part I, which deals with the basic constructs that make up the user interface, and move on to the remainder of the book where the new features found in Visual Studio 2008 are discussed in detail.

If you’re just starting out, you’ll greatly benefit from the first part, where basic concepts are explained and you’re introduced to the user interface and how to customize it to suit your own style.

This book does assume that you are familiar with the traditional programming model, and it uses both the C# and Visual Basic languages to illustrate features within Visual Studio 2008. In addition, it is assumed that you can understand the code listings without an explanation of basic programming concepts in either language. If you’re new to programming and want to learn Visual Basic, please take a look at Beginning Visual Basic 2008 by Thearon Willis and Bryan Newsome. Similarly, if you are after a great book on C#, track down Beginning Visual C# 2008, written collaboratively by a host of authors.

What This Book Covers

Microsoft Visual Studio 2008 is arguably the most advanced integrated development environment (IDE) available for programmers today. It is based on a long history of programming languages and interfaces and has been influenced by many different iterations of the theme of development environments.

The next few pages introduce you to Microsoft Visual Studio 2008, how it came about, and what it can do for you as a developer. If you’re already familiar with what Visual Studio is and how it came to be, you may want to skip ahead to the next chapter and dive into the various aspects of the integrated development environment itself.

A Brief History of Visual Studio

Microsoft has worked long and hard on its development tools. Actually, its first software product was a version of BASIC in 1975. Back then, programming languages were mainly interpretive languages in which the computer would process the code to be performed line by line. In the past three decades, programming has seen many advances, one of the biggest by far being development environments aimed at helping developers be efficient at producing applications in their chosen language and platform.

In the 32-bit computing era, Microsoft started releasing comprehensive development tools, commonly called IDEs (short for integrated development environments), which contained not just a compiler but also a host of other features to supplement it, including a context-sensitive editor and rudimentary IntelliSense features that helped programmers determine what they could and couldn’t do in a given situation. Along with these features came intuitive visual user interface designers with drag-and-drop functionality and associated tool windows that gave developers access to a variety of properties for the various components on a given window or user control.

Initially, these IDEs were different for each language, with Visual Basic being the most advanced in terms of the graphical designer and ease of use, and Visual C++ having the most power and flexibility. Under the banner of Visual Studio 6, the latest versions of these languages were released in one large development suite along with other “Visual” tools such as FoxPro and InterDev. However, it was obvious that each language still had a distinct environment in which to work, and as a result, development solutions had to be in a specific language.

One Comprehensive Environment

When Microsoft first released Visual Studio .NET in 2002, it inherited many features and attributes of the various, disparate development tools the company had previously offered. Visual Basic 6, Visual InterDev, Visual C++, and other tools such as FoxPro all contributed to a development effort that the Microsoft development team mostly created on its own. The team had some input from external groups, but Visual Studio .NET 2002 and .NET 1.0 were primarily founded on Microsoft’s own principles and goals.

Visual Studio .NET 2003 was the next version released, and it provided mostly small enhancements and big fixes. Two years later, Visual Studio 2005 and the .NET Framework 2.0 were released. This was a major new edition with new foundation framework classes that went far beyond anything Microsoft had released previously. However, the most significant part of this release was realized in the IDE where the various components fit together in a cohesive way to provide you with an efficient tool set where everything was easily accessible.

The latest release, Visual Studio 2008 and .NET Framework 3.5, builds on this strong foundation. LINQ promises to revolutionize the way you access data, and features that were previously separate downloads, such as ASP.NET AJAX and Visual Studio Tools for Office, are now included by default.

The Visual Studio 2008 development environment (see Figure I-1) takes the evolution of Microsoft IDEs even further along the road to a comprehensive set of tools that can be used regardless of your purpose as a developer. A quick glance at Figure I-1 shows the cohesive way in which the various components fit together to provide you with an efficient tool set with everything easily accessible.

Figure I-1

Visual Studio 2008 comes in several versions: Express, Standard, Professional, and Team System (to be accurate, there are four distinct flavors of Team System for different roles, but their core Visual Studio functionality remains the same). The majority of this book deals with the Professional Edition of Visual Studio 2008, but some parts utilize features found only in Team System. If you haven’t used Team System before, read through Chapters 54 to 58 for an overview of the features it offers over and above the Professional Edition.

How This Book Is Structured

This book’s first section is dedicated to familiarizing you with the core aspects of Visual Studio 2008. Everything you need is contained in the first five chapters, from the IDE structure and layout to the various options and settings you can change to make the user interface synchronize with your own way of doing things.

From there, the remainder of the book is broken into 11 parts:

Getting Started: In this part, you learn how to take control of your projects, how to organize them in ways that work with your own style, and how to edit application configuration and XML resource files.

Languages: The .NET languages continue to evolve to support new features that are added to the framework. In the latest version of the framework, enhancements were added to support the introduction of LINQ, namely implicit typing, object initialization, and lambda expressions. Add these to features introduced in earlier versions, such as generics and partial types, and you’ve got an extremely expressive and powerful framework for building applications. This part covers all these features and more.

Coding: Though the many graphical components of Visual Studio that make a programmer’s job easier are discussed in many places throughout this book, you often need help when you’re in the process of actually writing code. This part deals with features that support the coding of applications such as IntelliSense, code refactoring, and creating and running unit tests.

Data: A large proportion of applications use some form of data storage. Visual Studio 2008 and the .NET Framework include strong support for working with databases and other data sources. This part examines how to use DataSets, the Visual Database Tools, LINQ, and Synchronization Services to build applications that work with data.

Security: Application security is a consideration that is often put off until the end of a development project or, in all too many cases, ignored completely. Rather than follow the trend and leave this topic to the end of the book, it is placed in a more appropriate place.

Platforms: For support building everything from Office add-ins to mobile applications, Visual Studio enables you to develop applications for a wide range of platforms. This part covers the application platforms that have always been supported, including ASP.NET, Office, and Mobile, as well as the application types that were introduced with .NET 3.0 (WPF, WCF, and WF). At the end of this part, you’ll find a chapter on building the next-generation web with Silverlight 2 and ASP.NET MVC.

Configuration and Internationalization: The built-in support for configuration files allows you to adjust the way an application functions on the fly without having to rebuild it. Furthermore, resource files can be used to both access static data and easily localize an application into foreign languages and cultures. This part of the book shows how to use .NET configuration and resource files.

Debugging: Application debugging is one of the more challenging tasks developers have to tackle, but correct use of the Visual Studio 2008 debugging features will help you analyze the state of the application and determine the cause of any bugs. This part examines the rich debugging support provided by the IDE.

Build and Deployment: In addition to discussing how to build your solutions effectively and getting applications into the hands of your end users, this part also deals with the process of upgrading your projects from previous versions.

Automation: If the functionality found in the previous part isn’t enough to help you in your coding efforts, Microsoft has provided many other features related to the concept of automating your programming work. This part starts by looking at the automation model, and then discusses add-ins and macros.

Visual Studio Team System: Visual Studio Team System gives organizations a single tool that can be used to support the entire software lifecycle. The final part of the book examines the additional features only available in the Team System versions of Visual Studio 2008. In addition, you’ll also learn how the Team Foundation Server provides an essential tool for managing software projects.

Though this breakdown of the Visual Studio feature set provides the most logical and easily understood set of topics, you may need to look for specific functions that will aid you in a particular activity. To address this need, references to appropriate chapters are provided whenever a feature is covered in more detail elsewhere in the book.

What You Need to Use This Book

To use this book effectively, you’ll need only one additional item — Microsoft Visual Studio 2008 Professional Edition. With this software installed and the information found in this book, you’ll be able to get a handle on how to use Visual Studio 2008 effectively in a very short period of time.

Some chapters discuss additional products and tools that work in conjunction with Visual Studio. The following are all available to download either on a trial basis, or for free:

Sandcastle: Using Sandcastle, you can generate comprehensive documentation for every member and class within your solutions from the XML comments in your code. XML comments and Sandcastle are discussed in Chapter 9.

F#: A multi-paradigm functional language, F# was incubated out of Microsoft Research in Cambridge, England. Chapter 15 covers the F# programming language.

Code Snippet Editor: This is a third-party tool developed for creating code snippets in Visual Basic. The Snippet Editor tool is discussed in Chapter 17.

SQL Server 2005: The installation of Visual Studio 2008 includes an install of SQL Server 2005 Express, enabling you to build applications that use database files. However, for more comprehensive enterprise solutions, you can use SQL Server 2005 instead. Database connectivity is covered in Chapter 22.

Silverlight 2: Silverlight 2 is a cross-platform, cross-browser runtime that includes a lightweight version of the .NET Framework and delivers advanced functionality such as vector graphics, animation, and streaming media. Silverlight 2 is discussed in Chapter 37.

ASP.NET MVC: The ASP.NET MVC framework provides a way to cleanly separate your application into model, view, and controller parts, thus enabling better testability and giving you more control over the behavior and output produced by your web application. Chapter 37 explains how to build applications with the ASP.NET MVC framework.

Web Deployment Projects: Using a Web Deployment Project, you can effectively customize your application so that it can be deployed with a minimal set of files. Web Deployment Projects are covered in Chapter 50.

Visual Studio 2008 Team System: A more powerful version of Visual Studio, Team System introduces tools for other parts of the development process such as testing and design. Team System is discussed in Chapters 54–58.

Conventions

To help you get the most from the text and keep track of what’s happening, we’ve used a number of conventions throughout the book.

Tips, hints, tricks, and asides to the current discussion are offset and placed in italics like this.

As for styles in the text:

We highlight new terms and important words when we introduce them.

We show keyboard strokes like this: Ctrl+A.

URLs and code that are referenced within the text use this format: persistence.properties.

We present code in two different ways:

Normal code examples are listed like this.

In code examples we highlight important code with a gray background.

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All of the source code used in this book is available for download at www.wrox.com. Once at the site, simply locate the book’s title (either by using the Search box or by using one of the title lists) and click the Download Code link on the book’s detail page to obtain all the source code for the book.

Because many books have similar titles, you may find it easiest to search by ISBN; this book’s ISBN is 978-0-470-22988-0.

Once you download the code, just decompress it with your favorite compression tool. Alternatively, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

Errata

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, such as a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration, and at the same time you will be helping us provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page you can view all errata that have been submitted for this book and posted by Wrox editors. A complete book list, including links to each book’s errata, is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don’t spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We’ll check the information and, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions of the book.

p2p.wrox.com

For author and peer discussion, join the P2P forums at http://p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies, and to interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com you will find a number of different forums that will help you not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

1. Go to http://p2p.wrox.com and click the Register link.

2. Read the terms of use and click Agree.

3. Complete the required information to join as well as any optional information you wish to provide and click Submit.

4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

You can read messages in the forums without joining P2P, but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

Part I

Integrated Development Environment

Chapter 1: A Quick Tour

Chapter 2: The Solution Explorer, Toolbox, and Properties

Chapter 3: Options and Customizations

Chapter 4: Workspace Control

Chapter 5: Find & Replace, and Help

Chapter 1

A Quick Tour

Ever since we have been developing software, there has been a need for tools to help us write, compile, and debug our applications. Microsoft Visual Studio 2008 is the next iteration in the continual evolution of a best-of-breed integrated development environment (IDE). If this is your first time using Visual Studio, then you will find this chapter a useful starting point. Even if you have worked with a previous version of Visual Studio, you may want to quickly skim it.

This chapter introduces the Visual Studio 2008 user experience and will show you how to work with the various menus, toolbars, and windows. It serves as a quick tour of the IDE, and as such it won’t go into detail about what settings can be changed or how to go about customizing the layout, as these topics will be explored in the following chapters.

Let’s Get Started

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!