Cover image for Mastering Visual Studio .NET

Book description

Mastering Visual Studio .NET provides you, as an experienced programmer, with all the information needed to get the most out of the latest and greatest development tool from Microsoft®. It doesn't matter if you're an MFC, C++, STL, ATL, COM, Win32, Visual Basic, C#, HTML, XML, ASP.NET, database, web application, Web service, NT service, stand-alone client, or component programmer targeting Windows® or one of the Windows variants (i.e. Windows CE or the PocketPC) -- this is the book that will help you master the toolkit. Written by experienced developers and trainers John Flanders, Ian Griffiths, and Chris Sells, Mastering Visual Studio .NET begins with fundamental information about maximizing the power of Visual Studio .NET as it comes out of the box, including the following topics:

  • projects and solutions

  • files and the various file editors

  • debugging

  • web projects

  • database projects

  • setup projects

  • integrating controls and components with VS.NET

  • the VS.NET automation object model

  • macros and add-ins

  • custom wizards

  • the Visual Studio Integration Program (VSIP)

To experience the full spectrum of functionality and extensibility, Mastering Visual Studio .NET provides you with the practical depth and detail needed to best put these features to work. The second section of the book is about extending VS.NET to suit your specific needs:

If you're serious about using the VS.NET toolkit, you'll want a book of this magnitude close by. Mastering Visual Studio .NET will take you beyond what you'll read in the standard documentation by offering hints and recommendations that the authors and the community at large have found to be useful after many years of experience.

Table of Contents

  1. Special Upgrade Offer
  2. Preface
    1. Audience
    2. Conventions
    3. How to Contact Us
    4. Acknowledgments
      1. Ian Griffiths
      2. Jon Flanders
      3. Chris Sells
  3. 1. Solutions and Projects
    1. Solutions
      1. Creating a Solution
      2. Saving Web-Based Projects
    2. Projects
      1. Project Types
        1. Managed local
        2. Managed web-based
        3. Smart Device
        4. Unmanaged local
        5. Unmanaged web-based
        6. Setup and deployment
        7. Other project types
      2. Adding Projects
      3. Managing files
        1. Adding a new file
        2. Adding an existing file
        3. Moving files between projects
        4. Removing or deleting a file
        5. File properties
      4. Solution Items
      5. Miscellaneous Files
    3. Solutions, Projects, and Dependencies
      1. Adding References to Projects
        1. The Copy Local property
        2. Adding references to COM components
        3. Adding references to other projects
      2. Project Dependencies and Build Order
      3. Configuration Manager
      4. Manual Building
      5. Automated Building
        1. External build tools
      6. Build Events
    4. Organizing Your Projects
      1. Single Solution File
      2. Multiple Solution Files with a Master
      3. Multiple Solution Files with No Project References
      4. Choosing an Organizational Method
    5. Conclusion
  4. 2. Files
    1. Text Editor
      1. IntelliSense
      2. C# Documentation
      3. Beautifier
      4. Navigation Bar
      5. Class View
      6. Navigation and Bookmarks
      7. Outlining and Regions
      8. Text and the Toolbox
      9. Clipboard Ring
      10. TaskList Comments
    2. HTML/XML Editor
      1. HTML Script-Only View
      2. HTML Views
      3. Schemas, Validation, and IntelliSense
      4. XML Data View
      5. XML Schema
    3. CSS Editor
    4. Design Views
      1. The Toolbox
      2. Nonvisual Components
      3. Windows Forms
      4. Web Forms/HTML
        1. HTML layout
        2. Server-side HTML elements
        3. Web Services
    5. Miscellaneous Editors
    6. Changing Editors
      1. Specifying an Encoding
    7. Custom Build Tools
    8. Conclusion
  5. 3. Debugging
    1. Starting the Debugger
      1. Launching to Debug
      2. Attaching to a Running Process
      3. Just-in-Time Debugging
        1. JIT debugging in Windows Forms applications
      4. ASP.NET Debugging
      5. Client-Side Script Debugging
    2. Controlling Execution
      1. Breakpoints
        1. Data breakpoints
        2. The Breakpoints window
      2. Halting on Errors
      3. Single-Stepping
        1. Stepping through multiple lines
        2. Changing the current point of execution
        3. Edit and continue
    3. Observing State
      1. Displaying Variables and Expressions
        1. Watch windows
        2. Autos, Locals, and This
      2. Registers
      3. The Call Stack
      4. Memory Windows
      5. The Output Window
      6. The Modules Window
    4. Debugging and Project Settings
      1. Release-Only Bugs
      2. Choosing Debugging Modes
    5. Advanced Debugging Techniques
      1. Crossing Language and Technology Boundaries
      2. Multiple Threads
      3. Multiple Processes
      4. Cross-Machine Debugging
        1. T-SQL debugging
      5. Alternative Debugging Protocols
      6. Symbol Servers
        1. Using a symbol store
        2. Creating and maintaining a symbol store
    6. Conclusion
  6. 4. Web Projects
    1. Web Project Templates
      1. IIS Virtual Directories and Web Applications
        1. Web applications and web projects
    2. Managed Web Projects
      1. Creating a New Web Project
      2. Storage of Project Files
      3. Codebehind
      4. Opening an Existing Web Project
      5. Building and Debugging
        1. Debugging with team projects
      6. FrontPage Versus File Share
    3. Visual C++ Projects
      1. Creating a New VC++ Web Project
      2. Files
      3. Building and Debugging
    4. Conclusion
  7. 5. Databases
    1. Server Explorer
    2. Database Diagram Designer
    3. Table Property Pages
      1. Tables Tab
      2. Columns Tab
      3. Relationships Tab
      4. Indexes/Keys Tab
      5. Check Constraints Tab
    4. Table Designer
    5. Query and View Designer
      1. Diagram Pane
      2. Grid Pane
      3. SQL Pane
      4. Results Pane
    6. SQL Editor
    7. Database Projects
      1. Creating a Database Project
      2. Connections and References
      3. Scripts and Databases
        1. Create scripts
        2. Change scripts
      4. Query Files
    8. Multiuser Issues
    9. Databases and .NET Projects
      1. Data Adapters
      2. Datasets and the XSD Designer
    10. Conclusion
  8. 6. Setup and Deployment
    1. Windows Installer
      1. Merge Modules
    2. Setup Project Types
    3. The Installation Process
    4. Views
    5. Project Properties and Conditions
    6. User Interface View
      1. UI Pages
        1. Welcome page
        2. Installation Folder page
        3. Installation Address page
        4. Confirm Installation page
        5. Progress page
        6. Finished page
        7. RadioButtons pages
        8. Checkboxes pages
        9. Textboxes pages
        10. Customer Information page
        11. License Agreement page
        12. Splash page
        13. Read Me page
        14. Register User page
    7. File System View
      1. Adding Project Output
        1. COM registration
      2. Adding Files
      3. Adding Assemblies
      4. Adding Merge Modules
    8. File Types View
      1. File Type Properties
      2. File Type Actions
    9. Registry View
    10. Custom Actions
      1. Example custom action
      2. .NET Installation Components
    11. Launch Conditions
      1. File Search
      2. Registry Search
      3. Windows Installer Search
    12. Cab Files
    13. Conclusion
  9. 7. Integrating Components with Visual Studio .NET
    1. Basic Integration
    2. Simple Integration Attributes
      1. Toolbox Bitmap
      2. Categories and Descriptions
        1. Localization
      3. Default Events and Properties
      4. Property Visibility
      5. Designer Serialization
      6. Data Binding
    3. Custom Property Types
      1. Type Converters
        1. Code serialization
      2. Custom UI Type Editors
    4. Custom Component Designers
      1. Adding Menu Verbs
      2. Windows Forms Control Designers
        1. Resizing and moving
        2. Adornments
        3. Handling mouse input
      3. Example Windows Forms Control with Designer
      4. Web Forms Control Designers
        1. Resizing
        2. Design-time rendering
    5. Conclusion
  10. 8. Automation, Macros, and Add-ins
    1. The VS.NET Automation Object Model
      1. Solution and Project Objects
        1. Project objects and VSProject
        2. Properties collections
      2. User Interface Objects
        1. Window objects
        2. CommandBar objects
      3. Command Objects
      4. Document Objects
      5. Debugger Object
      6. Source Control Object
      7. DTE Events
    2. Macros
      1. Recording and Running a Macro
      2. Editing with the Macro IDE
      3. Managing Macro Files
      4. Extending a Recorded Macro
        1. Setting project properties
      5. Building a Custom Macro
      6. Handling Events in Macros
      7. Debugging
      8. Limitations
    3. Add-ins
      1. Design Choices
        1. Configuring add-ins
      2. Installation
      3. Debugging
    4. Conclusion
  11. 9. Wizards
    1. Wizard Basics
      1. Implementation Choices
      2. Adding Wizards
        1. Item wizard .vsdir files
      3. .vsz Files
    2. The VS.NET Wizard Engine
      1. Wizard Execution
        1. The UI
        2. The script and the templates
      2. Template Directives
      3. Copying and Modifying an Existing Wizard
    3. Custom Wizard Engines
    4. Conclusion
  12. 10. Visual Studio Integration Program
    1. Why VSIP?
      1. Typical Package Execution Path
    2. Creating Custom Packages
      1. Views
      2. Language Services
      3. New Project Type
      4. Debugging Engines and Expression Evaluators
    3. Conclusion
  13. A. Project Templates
    1. Visual Basic, C#, and J# Projects
    2. Visual C++ Projects
      1. Visual C++ .NET Projects
      2. Visual C++ ATL Projects
      3. Visual C++ MFC Projects
      4. Visual C++ Win32 Projects
      5. Visual C++ General Projects
    3. Setup and Deployment
    4. Other Projects
      1. Database Projects
      2. Enterprise Template Projects
      3. Visual Basic/Visual C# Building Blocks
      4. Visual Studio Analyzer Projects
      5. Extensibility Projects
      6. Application Center Test Projects
    5. Visual Studio Solutions
  14. B. Project Item Templates
    1. VB.NET, C#, and J# Templates
    2. VB.NET Templates
    3. C++ Templates
    4. ATL Templates
    5. MFC Templates
    6. Text-Based Templates
    7. Database
    8. HTML (Web)
    9. XML
    10. Binary and Resource Templates
  15. C. Shortcut Key Guide
  16. D. Source Control Basics
    1. Creating a VSS Database
    2. Adding a Solution
    3. Files
    4. Checking In and Out
      1. Checking Out Versus Getting Latest Version
      2. Check In Frequently
    5. Retrieving a Project
    6. File History
    7. Diffs
    8. Disconnected Operation
    9. Web Projects
  17. E. Solution and Project File Formats
    1. Solution Files
      1. .sln file
    2. Project Files
      1. User Files
      2. Web Files
  18. F. Text Editor Settings
    1. Global Settings
      1. Fonts and Colors
    2. Generic Settings
      1. General
      2. Tabs
    3. VB.NET
    4. C# and J#
    5. C/C++
    6. HTML/XML
    7. CSS
    8. Plain Text and SQL Settings
  19. Index
  20. About the Authors
  21. Colophon
  22. Special Upgrade Offer
  23. Copyright