professional visual studio 2012

1.1K 3.4K 2
professional visual studio 2012

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info ffirs.indd iffirs.indd i 10/18/2012 6:16:02 PM10/18/2012 6:16:02 PM www.it-ebooks.info PROFESSIONAL VISUAL STUDIO® 2012 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxix  PART I INTEGRATED DEVELOPMENT ENVIRONMENT CHAPTER 1 A Quick Tour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 CHAPTER 2 The Solution Explorer, Toolbox, and Properties . . . . . . . . . . . . . . . . . . . . .13 CHAPTER 3 Options and Customizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 CHAPTER 4 The Visual Studio Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 CHAPTER 5 Find and Replace and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67  PART II GETTING STARTED CHAPTER 6 Solutions, Projects, and Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 CHAPTER 7 IntelliSense and Bookmarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 CHAPTER 8 Code Snippets and Refactoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 CHAPTER 9 Server Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 CHAPTER 10 Modeling with the Class Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163  PART III DIGGING DEEPER CHAPTER 11 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177 CHAPTER 12 Documentation with XML Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 CHAPTER 13 Code Consistency Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 CHAPTER 14 Code Generation with T4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 CHAPTER 15 Project and Item Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 CHAPTER 16 Language-Specifi c Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275  PART IV RICH CLIENT APPLICATIONS CHAPTER 17 Windows Forms Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 CHAPTER 18 Windows Presentation Foundation (WPF) . . . . . . . . . . . . . . . . . . . . . . . . 305 CHAPTER 19 O ce Business Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 CHAPTER 20 Windows Store Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Continues ffirs.indd iffirs.indd i 10/18/2012 6:16:02 PM10/18/2012 6:16:02 PM www.it-ebooks.info  PART V WEB APPLICATIONS CHAPTER 21 ASP.NET Web Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 CHAPTER 22 ASP.NET MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 CHAPTER 23 Silverlight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 CHAPTER 24 Dynamic Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 CHAPTER 25 SharePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 CHAPTER 26 Windows Azure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483  PART VI DATA CHAPTER 27 Visual Database Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 CHAPTER 28 DataSets and DataBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509 CHAPTER 29 Language Integrated Queries (LINQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 CHAPTER 30 The ADO.NET Entity Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 CHAPTER 31 Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583  PART VII APPLICATION SERVICES CHAPTER 32 Windows Communication Foundation (WCF) . . . . . . . . . . . . . . . . . . . . . 619 CHAPTER 33 Windows Workfl ow Foundation (WF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639 CHAPTER 34 Client Application Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 CHAPTER 35 Synchronization Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 CHAPTER 36 WCF RIA Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689  PART VIII CONFIGURATION AND RESOURCES CHAPTER 37 Confi guration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 CHAPTER 38 Connection Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 CHAPTER 39 Resource Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731  PART IX DEBUGGING CHAPTER 40 Using the Debugging Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .751 CHAPTER 41 Debugging with Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769 CHAPTER 42 DataTips, Debug Proxies, and Visualizers . . . . . . . . . . . . . . . . . . . . . . . . 781 CHAPTER 43 Debugging Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793 CHAPTER 44 Advanced Debugging Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .811 ffirs.indd iiffirs.indd ii 10/18/2012 6:16:03 PM10/18/2012 6:16:03 PM www.it-ebooks.info  PART X BUILD AND DEPLOYMENT CHAPTER 45 Upgrading with Visual Studio 2012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831 CHAPTER 46 Build Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837 CHAPTER 47 Assembly Versioning and Signing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853 CHAPTER 48 Obfuscation, Application Monitoring, and Management . . . . . . . . . . . 861 CHAPTER 49 Packaging and Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881 CHAPTER 50 Web Application Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895  PART XI CUSTOMIZING AND EXTENDING VISUAL STUDIO CHAPTER 51 The Automation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .909 CHAPTER 52 Add-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917 CHAPTER 53 Managed Extensibility Framework (MEF) . . . . . . . . . . . . . . . . . . . . . . . . 931  PART XII VISUAL STUDIO ULTIMATE CHAPTER 54 Visual Studio Ultimate for Architects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953 CHAPTER 55 Visual Studio Ultimate for Developers . . . . . . . . . . . . . . . . . . . . . . . . . . .965 CHAPTER 56 Visual Studio Ultimate for Testers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983 CHAPTER 57 Team Foundation Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 997 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021 ffirs.indd iiiffirs.indd iii 10/18/2012 6:16:03 PM10/18/2012 6:16:03 PM www.it-ebooks.info ffirs.indd ivffirs.indd iv 10/18/2012 6:16:03 PM10/18/2012 6:16:03 PM www.it-ebooks.info PROFESSIONAL Visual Studio® 2012 Bruce Johnson ffirs.indd vffirs.indd v 10/18/2012 6:16:03 PM10/18/2012 6:16:03 PM www.it-ebooks.info Professional Visual Studio® 2012 Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-33770-7 ISBN: 978-1-118-41648-8 (ebk) ISBN: 978-1-118-43407-9 (ebk) ISBN: 978-1-118-46390-1 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 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 Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, 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 speci cally disclaim all warranties, including without limitation warranties of  tness for a particular purpose. No warranty may be created or extended by sales or pro- motional 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 pub- lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site 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 Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites 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 (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan- dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2012944689 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 af liates, in the United States and other coun- tries, and may not be used without written permission. Visual Studio is a registered trademark of Microsoft Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book. ffirs.indd viffirs.indd vi 10/18/2012 6:16:04 PM10/18/2012 6:16:04 PM www.it-ebooks.info I’d like to thank my wife, Ali, and my four children, Kyle, Cameron, Gillian, and Curtis, for their love and support. While they might not have written any of the words directly, they certainly helped create an environment where I could get my ideas out my head and into the computer. — B J ffirs.indd viiffirs.indd vii 10/18/2012 6:16:04 PM10/18/2012 6:16:04 PM www.it-ebooks.info ACQUISITIONS EDITOR Mary James PROJECT EDITOR Kelly Talbot TECHNICAL EDITORS Joe Bennett Andrew Moore PRODUCTION EDITOR Christine Mugnolo COPY EDITOR San Dee Phillips EDITORIAL MANAGER Mary Beth Wakefi eld FREELANCER EDITORIAL MANAGER Rosemarie Graham ASSOCIATE DIRECTOR OF MARKETING David Mayhew MARKETING MANAGER Ashley Zurcher BUSINESS MANAGER Amy Knies PRODUCTION MANAGER Tim Tate VICE PRESIDENT AND EXECUTIVE GROUP PUBLISHER Richard Swadley VICE PRESIDENT AND EXECUTIVE PUBLISHER Neil Edde ASSOCIATE PUBLISHER Jim Minatel PROJECT COORDINATOR, COVER Katie Crocker PROOFREADERS Jennifer Bennett, Word One New York Scott Klemp, Word One New York James Saturnio, Word One New York INDEXER Johnna VanHoose Dinse COVER DESIGNER LeAndra Young COVER IMAGE © Eric Delmar / iStockPhoto CREDITS ffirs.indd viiiffirs.indd viii 10/18/2012 6:16:04 PM10/18/2012 6:16:04 PM www.it-ebooks.info [...]... questions I had — Bruce Johnson www.it-ebooks.info ffirs.indd xi 10/18 /2012 6:16:04 PM www.it-ebooks.info ffirs.indd xii 10/18 /2012 6:16:04 PM CONTENTS INTRODUCTION xxxix PART I: INTEGRATED DEVELOPMENT ENVIRONMENT CHAPTER 1: A QUICK TOUR 3 Getting Started 3 Installing Visual Studio 2012 Running Visual Studio 2012 3 4 The Visual Studio IDE 5 Developing, Building, Debugging, and Deploying Your First... 10/18 /2012 6:16:50 PM CONTENTS PART X: BUILD AND DEPLOYMENT CHAPTER 45: UPGRADING WITH VISUAL STUDIO 2012 831 Upgrading from Visual Studio 2010 Upgrading to NET Framework 4.5 Summary 831 833 835 CHAPTER 46: BUILD CUSTOMIZATION 837 General Build Options Manual Dependencies The Visual Basic Compile Page 837 840 840 Advanced Compiler Settings Build Events 841 843 C# Build Pages MSBuild 845 846 How Visual Studio. .. EXTENDING VISUAL STUDIO CHAPTER 51: THE AUTOMATION MODEL 909 Visual Studio Extensibility Options The Visual Studio Automation Model 909 910 An Overview of the Automation Model Solutions and Projects Windows and Documents Commands Debugger Events 910 912 912 914 915 916 Summary 916 CHAPTER 52: ADD-INS 917 Developing an Add-in 917 The Add-in Wizard 917 xxxiv www.it-ebooks.info ftoc.indd xxxiv 10/18 /2012 6:16:50... Access Control Service 496 496 Azure Websites Azure Virtual Machines 496 497 Connectivity 497 Summary 498 xxiv www.it-ebooks.info ftoc.indd xxiv 10/18 /2012 6:16:50 PM CONTENTS PART VI: DATA CHAPTER 27: VISUAL DATABASE TOOLS Database Windows in Visual Studio 2012 Server Explorer The Data Sources Window SQL Server Object Explorer 501 501 502 506 506 Editing Data Summary 507 508 CHAPTER 28: DATASETS AND DATABINDING... Docking The Editor Space 33 33 34 37 Fonts and Colors Visual Guides Full-Screen Mode Tracking Changes 38 38 40 40 www.it-ebooks.info ftoc.indd xiii 10/18 /2012 6:16:49 PM CONTENTS Other Options 41 Keyboard Shortcuts Quick Launch Projects and Solutions Build and Run VB Options 41 42 43 44 45 Importing and Exporting Settings Summary CHAPTER 4: THE VISUAL STUDIO WORKSPACE The Code Editor 45 47 49 49 The Code... Properties 86 88 88 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 89 92 93 94 94 96 97 97 98 99 100 100 101 102 102 xv www.it-ebooks.info ftoc.indd xv 10/18 /2012 6:16:49 PM CONTENTS Web Application... Drag-and-Drop Code Generation IntelliSense Code Generation Refactoring with the Class Designer Modeling Power Toys for Visual Studio Visualization Enhancements Functionality Enhancements 166 167 168 168 169 169 171 171 172 172 173 Summary 174 xvii www.it-ebooks.info ftoc.indd xvii 10/18 /2012 6:16:49 PM CONTENTS PART III: DIGGING DEEPER CHAPTER 11: UNIT TESTING Your First Test Case 177 177 Identifying... DATATIPS, DEBUG PROXIES, AND VISUALIZERS DataTips Debugger Attributes 781 781 783 DebuggerBrowsable DebuggerDisplay DebuggerHidden DebuggerStepThrough DebuggerNonUserCode DebuggerStepperBoundary 783 784 784 785 786 786 Type Proxies 786 Raw View 788 Visualizers Advanced Techniques 788 790 Saving Changes to Your Object Summary 790 792 xxxi www.it-ebooks.info ftoc.indd xxxi 10/18 /2012 6:16:50 PM CONTENTS... all of this activity (or, perhaps, in spite of it), Bruce has been privileged to be recognized as a Microsoft MVP for the past six years www.it-ebooks.info ffirs.indd ix 10/18 /2012 6:16:04 PM www.it-ebooks.info ffirs.indd x 10/18 /2012 6:16:04 PM ACKNOWLEDGMENTS TO THE OUTSIDE, it might look like the writing of a book is an individual effort Having gone through this act of creation a number of times, I... ftoc.indd xix 10/18 /2012 6:16:50 PM CONTENTS IWizard Generating the Extended Project Template Starter Kits Online Templates Summary 266 271 272 273 273 CHAPTER 16: LANGUAGE-SPECIFIC FEATURES Hitting a Nail with the Right Hammer Imperative Declarative Dynamic Functional What’s It All Mean? 275 275 276 276 276 277 277 A Tale of Two Languages 278 The Async Keyword Caller Information 278 280 Visual Basic 281 . iii 10/18 /2012 6:16:03 PM10/18 /2012 6:16:03 PM www.it-ebooks.info ffirs.indd ivffirs.indd iv 10/18 /2012 6:16:03 PM10/18 /2012 6:16:03 PM www.it-ebooks.info PROFESSIONAL Visual Studio 2012 Bruce. ENVIRONMENT CHAPTER 1: A QUICK TOUR 3 Getting Started 3 Installing Visual Studio 2012 3 Running Visual Studio 2012 4 The Visual Studio IDE 5 Developing, Building, Debugging, and Deploying Your. www.it-ebooks.info ffirs.indd iffirs.indd i 10/18 /2012 6:16:02 PM10/18 /2012 6:16:02 PM www.it-ebooks.info PROFESSIONAL VISUAL STUDIO 2012 INTRODUCTION . . . . . . . . . . . . . . . . . .

Ngày đăng: 11/04/2014, 09:48

Từ khóa liên quan

Mục lục

  • Professional Visual Studio® 2012

  • Copyright

  • Credits

  • About the Author

  • 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

    • Errata

    • P2P.wrox.Com

    • Part I: Integrated Development Environment

      • Chapter 1: A Quick Tour

        • Getting Started

          • Installing Visual Studio 2012

          • Running Visual Studio 2012

          • 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

Tài liệu cùng người dùng

Tài liệu liên quan