Comprehensive guide to Visual Studio 2013 Visual Studio is your essential tool for Windows programming. Visual Studio 2013 features important updates to the user interface and to productivity. In Professional Visual Studio 2013, author, Microsoft Certified Trainer, and Microsoft Visual C# MVP Bruce Johnson brings three decades of industry experience to guide you through the update, and he doesn't just gloss over the basics. With his unique IDE-centric approach, he steers into the nooks and crannies to help you use Visual Studio 2013 to its maximum potential. * Choose from more theme options, check out the new icons, and make your settings portable * Step up your workflow with hover colors, auto brace completion, peek, and CodeLens * Code ASP.NET faster than ever with new shortcuts * Get acquainted with the new SharePoint 2013 environment * Find your way around the new XAML editor for Windows Store apps Visual Studio 2013 includes better support for advanced debugging techniques, vast improvements to the visual database tools, and new support for UI testing for Windows Store apps. This update is the key to smoother, quicker programming, and Professional Visual Studio 2013 is your map to everything inside.
Author(s): Bruce Johnson
Publisher: Wrox
Year: 2014
Language: English
Pages: 1104
Professional Visual Studio® 2013
Copyright
About the Author
Credits
Acknowledgments
Contents
Introduction
Who This Book Is For
What This Book Covers
How This Book Is Structured
What You Need to Use This Book
Conventions
Source Code
Errata
P2P.Wrox.Com
Part I: Integrated Development Environment
Chapter 1: A Quick Tour
Getting Started
Installing Visual Studio 2013
Running Visual Studio 2013
Is Visual Studio Really Cloud Enabled?
The Visual Studio IDE
Developing, Building, Debugging, and Deploying Your First Application
Summary
Chapter 2: The Solution Explorer, Toolbox, and Properties
The Solution Explorer
Previewing Files
Common Tasks
The Toolbox
Arranging Components
Adding Components
Properties
Extending the Properties Window
Summary
Chapter 3: Options and Customizations
The Start Page
Customizing the Start Page
Window Layout
Viewing Windows and Toolbars
Navigating Open Items
Docking
The Editor Space
Fonts and Colors
Visual Guides
Full-Screen Mode
Tracking Changes
Other Options
Keyboard Shortcuts
Quick Launch
Projects and Solutions
Build and Run
VB Options
Importing and Exporting Settings
Synchronized Settings
Summary
Chapter 4: The Visual Studio Workspace
The Code Editor
The Code Editor Window Layout
Regions
Outlining
Code Formatting
Navigating Forward/Backward
Additional Code Editor Features
Split View
Tear Away (Floating) Code Windows
Duplicating Solution Explorer
Creating Tab Groups
Advanced Functionality
Code Navigation
Peek Definition
Enhanced Scrollbar
Navigate To
The Command Window
The Immediate Window
The Class View
The Error List
The Object Browser
The Code Definition Window
The Call Hierarchy Window
The Document Outline Tool Window
HTML Outlining
Control Outlining
Reorganizing Tool Windows
Summary
Chapter 5: Find and Replace and Help
Quick Find/Replace
Quick Find
Quick Replace
Find Options
Find and Replace Options
Find/Replace in Files
Find in Files
Find Dialog Options
Regular Expressions
Results Window
Replace in Files
Accessing Help
Navigating and Searching the Help System
Configuring the Help System
Summary
Part II: Getting Started
Chapter 6: Solutions, Projects, and Items
Solution Structure
Solution File Format
Solution Properties
Common Properties
Configuration Properties
Project Types
Project Files Format
Project Properties
Application
Compile (Visual Basic Only)
Build (C# and F# Only)
Build Events (C# and F# Only)
Debug
References (Visual Basic Only)
Resources
Services
Settings
Reference Paths (C# and F# Only)
Signing
My Extensions (Visual Basic Only)
Security
Publish
Code Analysis
Web Application Project Properties
Web
Silverlight Applications
Package/Publish Web
Package/Publish SQL
Web Site Projects
Summary
Chapter 7: IntelliSense and Bookmarks
IntelliSense Explained
General IntelliSense
IntelliSense and C++
Completing Words and Phrases
Parameter Information
Quick Info
JavaScript IntelliSense
The JavaScript IntelliSense Context
Referencing Another JavaScript File
XAML IntelliSense
IntelliSense Options
General Options
Statement Completion
C#-Specific Options
Extended IntelliSense
Code Snippets
XML Comments
Adding Your Own IntelliSense
Bookmarks and the Bookmark Window
Summary
Chapter 8: Code Snippets and Refactoring
Code Snippets Revealed
Storing Code Blocks in the Toolbox
Code Snippets
Using Snippets in C#
Using Snippets in VB
Surround With Snippet
Code Snippets Manager
Creating Snippets
Reviewing Existing Snippets
Using Snippets in XAML
Distributing Code Snippets
Accessing Refactoring Support
Refactoring Actions
Extract Method
Encapsulate Field
Extract Interface
Reorder Parameters
Remove Parameters
Rename
Generate Method Stub
Organize Usings
Summary
Chapter 9: Server Explorer
Server Connections
Event Logs
Management Classes
Management Events
Message Queues
Performance Counters
Services
Data Connections
SharePoint Connections
Summary
Chapter 10: Modeling with the Class Designer
Creating a Class Diagram
The Design Surface
The Toolbox
Entities
Connectors
The Class Details
The Properties Window
Layout
Exporting Diagrams
Code Generation and Refactoring
Drag-and-Drop Code Generation
IntelliSense Code Generation
Refactoring with the Class Designer
Summary
Part III: Digging Deeper
Chapter 11: Unit Testing
Your First Test Case
Identifying Tests Using Attributes
Additional Test Attributes
Unit Tests and Code Lens
Asserting the Facts
The Assert Class
The StringAssert Class
The CollectionAssert Class
The ExpectedException Attribute
Initializing and Cleaning Up
TestInitialize and TestCleanup
ClassInitialize and ClassCleanup
AssemblyInitialize and AssemblyCleanup
Testing Context
Data
Writing Test Output
Advanced Unit Testing
Custom Properties
Testing Private Members
Testing Code Contracts
Summary
Chapter 12: Documentation with XML Comments
Inline Commenting
XML Comments
Adding XML Comments
XML Comment Tags
Using XML Comments
IntelliSense Information
Generating Documentation with GhostDoc
Compiling Documentation with Sandcastle
Task List Comments
Summary
Chapter 13: Code Consistency Tools
Source Control
Selecting a Source Control Repository
Accessing Source Control
Coding Standards
Code Analysis with FxCop
Code Contracts
Summary
Chapter 14: Code Generation with T4
Creating a T4 Template
T4 Building Blocks
Expression Blocks
Statement Blocks
Class Feature Blocks
How T4 Works
T4 Directives
Template Directive
Output Directive
Assembly Directive
Import Directive
Include Directive
Troubleshooting
Design-Time Errors
Compiling Transformation Errors
Executing Transformation Errors
Generated Code Errors
Generating Code Assets
Runtime Text Templates
Using Runtime Text Templates
Differences between Runtime Text Templates and Standard T4 Templates
Tips and Tricks
Summary
Chapter 15: Project and Item Templates
Creating Templates
Item Template
Project Template
Template Structure
Template Parameters
Template Locations
Extending Templates
Template Project Setup
IWizard
Generating the Extended Project Template
Starter Kits
Online Templates
Summary
Chapter 16: Language-Specific Features
Hitting a Nail with the Right Hammer
Imperative
Declarative
Dynamic
Functional
What's It All Mean?
A Tale of Two Languages
The Async Keyword
Caller Information
Visual Basic
Iterators
The Global Keyword
F#
Your First F# Program
Exploring F# Language Features
Type Providers
Query Expressions
Auto-Implemented Properties
Summary
Part IV: Rich Client Applications
Chapter 17: Windows Forms Applications
Getting Started
The Windows Form
Appearance Properties
Layout Properties
Window Style Properties
Form Design Preferences
Adding and Positioning Controls
Vertically Aligning Text Controls
Automatic Positioning of Multiple Controls
Tab Order and Layering Controls
Locking Control Design
Setting Control Properties
Service-Based Components
Smart Tag Tasks
Container Controls
Panel and SplitContainer
FlowLayoutPanel
TableLayoutPanel
Docking and Anchoring Controls
Summary
Chapter 18: Windows Presentation Foundation (WPF)
What Is WPF?
Getting Started with WPF
XAML Fundamentals
The WPF Controls
The WPF Layout Controls
The WPF Designer and XAML Editor
Working with the XAML Editor
Working with the WPF Designer
The Properties Tool Window
Data Binding Features
Styling Your Application
Windows Forms Interoperability
Hosting a WPF Control in Windows Forms
Hosting a Windows Forms Control in WPF
Debugging with the WPF Visualizer
Summary
Chapter 19: Office Business Applications
Choosing an Office Project Type
Document-Level Customizations
Application-Level Add-Ins
Creating a Document-Level Customization
Your First VSTO Project
Protecting the Document Design
Adding an Actions Pane
Creating an Application Add-In
Some Outlook Concepts
Creating an Outlook Form Region
Debugging Office Applications
Unregistering an Add-In
Disabled Add-Ins
Deploying Office Applications
Summary
Chapter 20: Windows Store Applications
What Is a Windows Store Application?
Content before Chrome
Snap and Scale
Semantic Zoom
Contracts
Tiles
Embrace the Cloud
Creating a Windows Store Application
The Windows 8 Simulator
Your Windows Store Application
Summary
Part V: Web Applications
Chapter 21: ASP.NET Web Forms
Web Application versus Web Site Projects
Creating Web Projects
Creating a Web Site Project
Creating a Web Application Project
Designing Web Forms
The HTML Designer
Positioning Controls and HTML Elements
Formatting Controls and HTML Elements
CSS Tools
Validation Tools
Web Controls
Navigation Components
User Authentication
Data Components
Web Parts
Master Pages
Rich Client-Side Development
Developing with JavaScript
Working with ASP.NET AJAX
Using AJAX Control Extenders
Summary
Chapter 22: ASP.NET MVC
Model View Controller
Getting Started with ASP.NET MVC
Choosing a Model
Controllers and Action Methods
MVC Scaffolding
Rendering a UI with Views
Advanced MVC
Routing
Action Method Parameters
Areas
Validation
Partial Views
Dynamic Data Templates
jQuery
Summary
Chapter 23: Silverlight
What Is Silverlight?
Getting Started with Silverlight
Navigation Framework
Theming
Enabling Running Out of Browser
Summary
Chapter 24: Dynamic Data
Creating a Dynamic Data Web Application
Adding a Data Model
Exploring a Dynamic Data Application
Customizing the Data Model
Scaffolding Individual Tables
Customizing Individual Data Fields
Adding Custom Validation Rules
Customizing the Display Format
Customizing the Presentation
Page Templates
Field Templates
Entity Templates
Filter Templates
Enabling Dynamic Data for Existing Projects
Summary
Chapter 25: SharePoint
SharePoint Execution Models
Farm Solution
Sandbox Solution
App Model
Preparing the Development Environment
Exploring SharePoint 2013
Creating a SharePoint Project
Building Custom SharePoint Components
Developing Web Parts
Creating Content Types and Lists
Adding Event Receivers
Creating SharePoint Workflows
Working with Features
Packaging and Deployment
Summary
Chapter 26: Windows Azure
The Windows Azure Platform
The Compute Emulator
Table, Blob, and Queue Storage
Application Deployment
SQL Azure
AppFabric
Service Bus
Access Control Service
Azure Websites
Azure Virtual Machines
Connectivity
Summary
Part VI: Data
Chapter 27: Visual Database Tools
Database Windows in Visual Studio 2013
Server Explorer
The Data Sources Window
SQL Server Object Explorer
Editing Data
Summary
Chapter 28: DataSets and DataBinding
DataSets Overview
Adding a Data Source
The DataSet Designer
Binding Data
BindingSource
BindingNavigator
Data Source Selections
Saving Changes
Inserting New Items
Validation
Customized DataSets
BindingSource Chains and the DataGridView
Working with Data Sources
The Web Service Data Source
Browsing Data
Summary
Chapter 29: Language Integrated Queries (LINQ)
LINQ Providers
Old-School Queries
Query Pieces
From
Select
Where
Group By
Custom Projections
Order By
Debugging and Execution
LINQ to XML
VB XML Literals
Creating XML with LINQ
Querying XML
Schema Support
LINQ to SQL
Creating the Object Model
Querying with LINQ to SQL
Binding LINQ to SQL Objects
LINQPad
Summary
Chapter 30: The ADO.NET Entity Framework
What Is the Entity Framework?
Comparison with LINQ to SQL
Entity Framework Concepts
Getting Started
Creating an Entity Model
The Entity Data Model Wizard
The Entity Framework Designer
Creating/Modifying Entities
Creating/Modifying Entity Associations
Entity Inheritance
Validating an Entity Model
Updating an Entity Model with Database Changes
Querying the Entity Model
LINQ to Entities Overview
Getting an Object Context
CRUD Operations
Navigating Entity Associations
Advanced Functionality
Updating a Database from an Entity Model
Adding Business Logic to Entities
Plain Old CLR Objects (POCO)
Summary
Chapter 31: Reporting
Getting Started with Reporting
Designing Reports
Defining Data Sources
Reporting Controls
Expressions, Placeholders, and Aggregates
Custom Code
Report Layout
Subreports
The Report Wizard
Rendering Reports
The Report Viewer Controls
Generating the Report
Rendering Reports to Different Formats
Deploying Reports
Summary
Part VII: Application Services
Chapter 32: Windows Communication Foundation (WCF)
What Is WCF?
Getting Started
Defining Contracts
Creating the Service Contract
Creating the Data Contract
Configuring WCF Service Endpoints
Hosting WCF Services
Consuming a WCF Service
Summary
Chapter 33: Windows Workflow Foundation (WF)
What Is Windows Workflow Foundation?
Why Use Windows Workflow?
Workflow Concepts
Activities
Control Flow Activities
Expressions
Workflow Run Time/Scheduler
Bookmarks
Persistence
Tracking
Getting Started
The Workflow Foundation Designer
Creating a Workflow
Designing a Workflow
Writing Code Activities
Executing a Workflow
Debugging Workflows
Testing Workflows
Hosting the Workflow Designer
Summary
Chapter 34: Client Application Services
Client Services
Role Authorization
User Authentication
Settings
Login Form
Offline Support
Summary
Chapter 35: Synchronization Services
Occasionally Connected Applications
Server Direct
Getting Started with Synchronization Services
Synchronization Services over N-Tiers
Summary
Chapter 36: WCF RIA Services
Getting Started
Domain Services
Domain Operations
Query Operations
Insert/Update/Delete Operations
Other Operation Types
Consuming a Domain Service in Silverlight
Summary
Part VIII: Configuration and Resources
Chapter 37: Configuration Files
.Config Files
Machine.Config
Web.Config
App.Config
Security.Config
ApplicationHost.Config
Configuration Schema
Section: configurationSections
Section: startup
Section: runtime
Section: system.runtime.remoting
Section: system.net
Section: cryptographySettings
Section: system.diagnostics
Section: system.web
Section: compiler
Configuration Attributes
Application Settings
Using appSettings
Project Settings
Dynamic Properties
Custom Configuration Sections
User Settings
Referenced Projects with Settings
Summary
Chapter 38: Connection Strings
Connection String Wizard
SQL Server Format
In-Code Construction
Encrypting Connection Strings
LocalDB
Summary
Chapter 39: Resource Files
What Are Resources?
Text File Resources
Resx Resource Files
Binary Resources
Adding Resources
Embedding Files as Resources
Naming Resources
Accessing Resources
Designer Files
Resourcing Your Application
Control Images
Satellite Resources
Cultures
Creating Culture Resources
Loading Culture Resource Files
Satellite Culture Resources
Accessing Specifics
Bitmap and Icon Loading
Cross-Assembly Referencing
ComponentResourceManager
Coding Resource Files
ResourceReader and ResourceWriter
ResxResourceReader and ResxResourceWriter
Custom Resources
Summary
Part IX: Debugging
Chapter 40: Using the Debugging Windows
The Code Window
Breakpoints
DataTips
The Breakpoints Window
The Output Window
The Immediate Window
The Watch Windows
QuickWatch
Watch Windows 1–4
Autos and Locals
The Code Execution Windows
Call Stack
Threads
Modules
Processes
The Memory Windows
Memory Windows 1–4
Disassembly
Registers
IntelliTrace (Ultimate Edition Only)
The Parallel Debugging Windows
Parallel Stacks
Parallel Tasks
Exceptions
Customizing the Exception Assistant
Unwinding an Exception
Summary
Chapter 41: Debugging with Breakpoints
Breakpoints
Setting a Breakpoint
Adding Break Conditions
Working with Breakpoints
Tracepoints
Creating a Tracepoint
Output Messages
Execution Control
Stepping through Code
Moving the Execution Point
Edit and Continue
Rude Edits
Stop Applying Changes
Summary
Chapter 42: DataTips, Debug Proxies, and Visualizers
DataTips
Debugger Attributes
DebuggerBrowsable
DebuggerDisplay
DebuggerHidden
DebuggerStepThrough
DebuggerNonUserCode
DebuggerStepperBoundary
Type Proxies
Raw View
Visualizers
Advanced Techniques
Saving Changes to Your Object
Summary
Chapter 43: Debugging Web Applications
Debugging Server-Side ASP.NET Code
Web Application Exceptions
Edit and Continue
Error Handling
Debugging Client-Side JavaScript
Setting Breakpoints in JavaScript Code
Debugging Dynamically Generated JavaScript
Debugging ASP.NET AJAX JavaScript
The Page Inspector
Tracing
Page-Level Tracing
Application-Level Tracing
Trace Output
The Trace Viewer
Custom Trace Output
Health Monitoring
Summary
Chapter 44: Advanced Debugging Techniques
Start Actions
Debugging with Code
The Debugger Class
The Debug and Trace Classes
Debugging Running Applications
Attaching to a Windows Process
Attaching to a Web Application
Remote Debugging
IntelliTrace
Code Map Debugging
.NET Framework Source
Multithreaded and Parallelized Application Debugging
Debugging SQL Server Stored Procedures
Mixed-Mode Debugging
Post-Mortem Debugging
Generating Dump Files
Debugging Dump Files
Summary
Part X: Build and Deployment
Chapter 45: Upgrading with Visual Studio 2013
Upgrading from Visual Studio 2012 or 2010
Upgrading to .NET Framework 4.5.1
Summary
Chapter 46: Build Customization
General Build Options
Manual Dependencies
The Visual Basic Compile Page
Advanced Compiler Settings
Build Events
C# Build Pages
MSBuild
How Visual Studio Uses MSBuild
The MSBuild Schema
Assembly Versioning via MSBuild Tasks
Summary
Chapter 47: Assembly Versioning and Signing
Assembly Naming
Version Consistency
Strongly Named Assemblies
The Global Assembly Cache
Signing an Assembly
Summary
Chapter 48: Obfuscation, Application Monitoring, and Management
The MSIL Disassembler
Decompilers
Obfuscating Your Code
Dotfuscator and Analytics
Obfuscation Attributes
Words of Caution
Application Monitoring and Management
Tamper Defense
Runtime Intelligence Instrumentation and Analytics
Application Expiry
Application Usage Tracking
Summary
Chapter 49: Packaging and Deployment
Windows Installer XML Toolset
Building an Installer
Using Heat to Create Fragments
The Service Installer
ClickOnce
One Click to Deploy
One Click to Update
Summary
Chapter 50: Web Application Deployment
Web Deployment
Publishing a Web Application
Copy Web Site
Web Project Installers
The Web Platform Installer
Extending the Web Platform Installer
Summary
Part XI: Customizing and Extending Visual Studio
Chapter 51: The Automation Model
Visual Studio Extensibility Options
The Visual Studio Automation Model
An Overview of the Automation Model
Solutions and Projects
Windows and Documents
Commands
Debugger
Events
Summary
Chapter 52: Add-Ins
Developing an Add-In
The Add-in Wizard
Project Structure
Testing Your Add-In
The .AddIn File
The Connect Class
Creating a Tool Window
Accessing the Visual Studio Automation Model
Handling Visual Studio Events
Deploying Add-Ins
Summary
Chapter 53: Managed Extensibility Framework (ME F)
Getting Started with MEF
Imports and Exports
Contracts
Catalogs
Advanced MEF
The Visual Studio Editor
The Text Model Subsystem
The Text View Subsystem
The Classification Subsystem
The Operations Subsystem
Extending the Editor
Editor Extension Points
Editor Services
The Check Comment Highlighter Extension
Summary
Part XII: Visual Studio Ultimate
Chapter 54: Visual Studio Ultimate for Architects
Modeling Projects
UML Diagrams
UML Model Explorer
Using Layer Diagrams to Verify Application Architecture
Linking to Team Foundation Server
Exploring Code
The Architecture Explorer
Dependency Graphs
Generate Sequence Diagram
Summary
Chapter 55: Visual Studio Ultimate for Developers
Code Metrics
Lines of Code
Depth of Inheritance
Class Coupling
Cyclomatic Complexity
Maintainability Index
Excluded Code
Managed Code Analysis Tool
C/C++ Code Analysis Tool
Profiling Tools
Configuring Profiler Sessions
Reports
Standalone Profiler
IntelliTrace
Database Tools
Database Schemas
SQL-CLR Support
Database Refactoring
Schema Compare
Static Analysis
Transact-SQL Editor
Best Practices
Summary
Chapter 56: Visual Studio Ultimate for Testers
Automated Tests
Web Performance Tests
Load Tests
Coded UI Test
Generic Tests
Ordered Test
Relating Code and Tests
Code Coverage
Visual Studio Test Management
Microsoft Test Manager
Testing Center
Lab Center
Summary
Chapter 57: Team Foundation Server
Team Project
Process Templates
Work Item Tracking
Work Item Queries
Work Item Types
Adding Work Items
Work Item State
Excel and Project Integration
Excel
Project
Version Control
Working from Solution Explorer
Check Out
Check In
Resolve Conflicts
Working Offline
Label
History
Annotate
Shelve
Branch
Merge
Team Foundation Build
Reporting and Business Intelligence
Team Portal
Documents
Process Guidance
SharePoint Lists
Dashboards
Summary
Index
Advertisement