Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Page
1
(This page has no text content)
Page
2
(This page has no text content)
Page
3
Visual Studio 2022 In-Depth Second Edition Explore the Fantastic Features of Visual Studio 2022! Ockert J. du Preez www.bpbonline.com
Page
4
Copyright © 2023 BPB Online All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor BPB Online or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. BPB Online has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, BPB Online cannot guarantee the accuracy of this information. Group Product Manager: Marianne Conor Publishing Product Manager: Eva Brawn Senior Editor: Connell Content Development Editor: Melissa Monroe Technical Editor: Anne Stokes Copy Editor: Joe Austin Language Support Editor: Justin Baldwin Project Coordinator: Tyler Horan Proofreader: Khloe Styles Indexer: V. Krishnamurthy Production Designer: Malcolm D'Souza Marketing Coordinator: Kristen Kramer First published: 2019 Second published: 2023 Published by BPB Online WeWork, 119 Marylebone Road London NW1 5PU UK | UAE | INDIA | SINGAPORE ISBN 978-93-5551-246-8
Page
5
www.bpbonline.com
Page
6
Dedicated to Elmarie Michaela Winton Björn
Page
7
About the Author Ockert J. du Preez has been in the coding industry for 20+ years and has written hundreds of developer articles over the years detailing his programming quests and adventures. These can be found on CodeGuru, Developer.com and Database Journal. He knows a broad spectrum of development languages including: C++, C#, VB.NET, JavaScript and HTML. He has written the following books: Visual Studio 2019 In-Depth (BpB Publications) JavaScript for Gurus (BpB Publications) Building Cross-Platform Modern Apps using Visual Studio Code (VS Code) High Performance Enterprise Apps using C# 10 and .NET 6.0 He was the Technical Editor for the following books Professional C++, 5th Edition by Marc Gregoire C++ Software Interoperability for Windows Programmers by Adam Gladstone He was a Microsoft Most Valuable Professional for .NET (2008–2017).
Page
8
Acknowledgement I want to thank my family for all their support, their belief in me and their never-ending support. I wish to extend a special thank you for everyone at Cowboy Café for bringing me coffee and allowing me to write this book in their cozy atmosphere. My gratitude also goes to the team at BPB Publications for their patience and support in writing this book. On another personal note: I’d like to thank everyone that never believed in me and always said that I would amount to nothing, without negativity, positivity never prospers.
Page
9
Preface This book peeks into every corner of the Visual Studio IDE and help you get started with the latest 2022 version. Right from installation, you’ll discover new areas within the tool, and also the optimal way to use the features you may already know. You'll learn, for example, how to extend Visual Studio with your own customizations, so that you can make it perform the way you want. You will then explore everything about .NET 6, Diagnose and debug applications and all the Collaboration tools in Visual Studio 2022.You will learn about the new AI IntelliCode, .NET MAUI and the C++ 20 features. Lastly you will explore Visual Studio 2022 on different platforms such as Linux, and macOS The details are listed below. Chapter 1 focuses on Installing Visual Studio 2022. It covers all the options and Add-ons to install and explore the new Visual Studio 2022 features. Chapter 2 focuses on all the new and exciting features of .NET 6. Chapter 3 This chapter will cover the new and enhanced features in the C# language. Chapter 4 inspects the Visual Studio 2022 IDE and examine its features and updates from previous versions of Visual Studio. Chapter 5 in this chapter, we will explore the new AI IntelliCode and its AI capabilities to cater for a better coding experience. Chapter 6 discusses all the built-in tools in Visual Studio 2022. It will describe their purpose as well as explain how to use them. Chapter 7 In this chapter you will learn about the awesome debugging tools Visual Studio 2022 has as well as their innerworkings. Chapter 8 Because the web is a completely different platform than Desktop applications, you need special tools to help with styling and bug fixing. Chapter 8 digs into tools dedicated to the ASP.NET environment. Chapter 9 explains the need for simulators, emulators and tools that help with creating beautiful responsive mobile apps for any market.
Page
10
Chapter 10 In the world of Cloud Computing, Visual Studio 2022 provides the best tools for working with Microsoft Azure. Chapter 10 explores Azure tools and more. Chapter 11 Visual Studio 2022 includes support for C++ 20, Chapter explores some of its new features. APPENDIX A This covers Cross-Platform applications in Visual Studio 2022 as well as Visual Studio for Mac features.
Page
11
Code Bundle and Coloured Images Please follow the link to download the Code Bundle and the Coloured Images of the book: https://rebrand.ly/8b48fd The code bundle for the book is also hosted on GitHub at https://github.com/bpbpublications/Visual-Studio-2022-In-Depth-2nd- Edition. In case there's an update to the code, it will be updated on the existing GitHub repository. We have code bundles from our rich catalogue of books and videos available at https://github.com/bpbpublications. Check them out! Errata We take immense pride in our work at BPB Publications and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors, if any, that may have occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at : errata@bpbonline.com Your support, suggestions and feedbacks are highly appreciated by the BPB Publications’ Family. Did you know that BPB offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.bpbonline.com and as a print book
Page
12
customer, you are entitled to a discount on the eBook copy. Get in touch with us at: business@bpbonline.com for more details. At www.bpbonline.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on BPB books and eBooks.
Page
13
Piracy If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at business@bpbonline.com with a link to the material. If you are interested in becoming an author If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit www.bpbonline.com. We have worked with thousands of developers and tech professionals, just like you, to help them share their insights with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. Reviews Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions. We at BPB can understand what you think about our products, and our authors can see your feedback on their book. Thank you! For more information about BPB, please visit www.bpbonline.com.
Page
14
Table of Contents Section - I: Getting to Know the Visual Studio 2022 IDE Introduction 1. Getting Started with Visual Studio 2022 Structure Objectives Why Visual Studio 2022? The Solution Explorer The Properties window Data Sources window Server Explorer window Azure Data connections Servers SharePoint connections Toolbox New features of Visual Studio 2022 New project dialog box IntelliCode completions Document indicator Solution filter Visual Studio 2022 updates Requirements and prerequisites Supported Operating Systems Hardware Supported languages Visual Studio 2022 Editions Installation options Windows Web and Cloud Mobile and gaming Other toolsets
Page
15
Choosing what to install Launching Visual Studio 2022 Conclusion Key topics Points to remember Questions Answers 2. Having a Look at .NET 6 Introduction Structure Objectives .NET Framework history Components of .NET Framework The Common Language Runtime The .NET Framework class library (FCL) New features in .NET 6 Blazor desktop apps .NET SDK Optional Workload improvements .NET SDK: NuGet package validation Application-wide default font Fast inner loop New Math APIs .NET 6 enhancements .NET Multi-platform App UI (.NET MAUI) System.Linq enhancements Date and Time enhancements Conclusion Key topics Questions Answers References 3. Language and Coding Changes in C# Introduction Structure Objectives
Page
16
The C# language Variables and constants Datatypes Creating / declaring variables Naming conventions Arrays and collections Arrays Collections Queues Stack Hashtable Enums Selection statements Iteration statements Source Code Generators Support Top-level statements Conclusion Questions Answers 4. Digging into the Visual Studio 2022 IDE Introduction Structure Objectives Standard IDE Windows Menus Toolbars Design Window Data sources Toolbox Team Explorer / Git Changes Notifications Resource view JSON outline Project properties window Add reference window Code window
Page
17
Debugging windows Output window Quick Watch Locals Tasks List Comparing desktop, mobile and web IDEs Windows Forms ASP.NET Xamarin.Forms (Mobile) Desktop IDE Mobile IDE Web IDE Visual Studio for Mac Visual Studio 2022 extensions Finding and installing extensions Image optimizer Creating a very basic extension IDE Productivity Power Tools Conclusion Key topics Points to remember Questions Answers Section - II: Using The Tools in Visual Studio 2022 5. AI IntelliCode Structure Objectives IntelliSense Template IntelliSense improvements in C++ Peek Window UI and live edits Nested template support Default argument watermarks AI IntelliCode Advantages of using IntelliCode Assisted IntelliSense
Page
18
Recommendations for types, based on code Inferring code style and formatting conventions Finding issues faster Focused code reviews Team completions Train models for team completions Argument completion Style and formatting conventions EditorConfig Conclusion Key Topics Points to remember Questions Answers 6. Built-in Coding Experience Tools Structure Objectives Built-In tools Hot Reload Force Run to Cursor Updated Icons Cascadia Code Product Themes Setting a theme in Visual Studio 2022 Conclusion Key topics Points to remember Questions Answers References 7. Diagnostics and Debugging Tools Structure Objectives Code cleanup Applying implicit / explicit type preferences
Page
19
Applying ‘this.’ qualification preferences Applying language/framework type preferences Add/remove braces for single-line control statements Add accessibility modifiers Apply expression/block body preferences Apply inline ‘out’ variables preferences Apply object/collection initialization preferences Search bar on debugging windows Search and highlighting Search navigation Search depth Debugging applications – Debugging in general Breakpoints Navigating code during debug mode Debug multiple processes Instrumentation profiler Collection via instrumentation Collection via sampling T-SQL debugger Conclusion Key topics Points to remember Questions Answers References Section - III: Advanced Tools 8. Web Tools and Extensions Structure Objectives Web Frameworks ASP.NET MVC Framework DotNetNuke (DNN Platform) MonoRail Blazor Getting started with Blazor and Visual Studio 2022
Page
20
Setting up Blazor Web API Creating a new Web API application Azure Conclusion Key topics Points to remember Questions Answers 9. Mobile Tools Structure Objectives JSON JSON structure JSON Schemas Combining multiple subschemas allOf anyOf oneOf not Complex schemas Xamarin Installing Xamarin Xamarin.Forms Creating a Xamarin.Forms App .NET MAUI Emulators and simulators Differences between simulators or emulators to test apps Visual Studio 2022 Android Emulator Setting up a new device Conclusion Key topics Points to remember Questions 10. Azure Tools
The above is a preview of the first 20 pages. Register to read the complete e-book.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A practical tour of the Visual Studio 2022 IDE that takes you from installation and workload choices through .NET 6, C#, IntelliCode, debugging, and cross-platform tooling. Best for developers who already write some code and want to use the IDE deliberately rather than by habit.
【Book Arc】
- **Opening (~0%–11%)**: Sets up the book's scope and walks through installing Visual Studio 2022, choosing workloads (desktop C++, web/cloud, data, mobile/gaming, toolsets), and understanding update and solution-filter options.
- **Early (~11%–29%)**: Moves into platform fundamentals — .NET 6 features (fast inner loop, Hot Reload, new Math and time-zone APIs) and a C# refresher covering variables, constants, arrays, collections, and selection statements.
- **Early–Middle (~29%–46%)**: Explores the IDE itself: data sources and datasets, resources, the JSON outline, project properties, the Toolbox across Windows Forms and ASP.NET, debugging windows, and a comparison of desktop, web, and mobile IDEs including Visual Studio for Mac.
- **Middle (~46%–50%)**: Shifts to AI-assisted coding with IntelliSense refinements (Parameter Info, Quick Info, Complete Word) and IntelliCode model training and inline suggestions.
- **Late (beyond ~50%; excerpts thin)**: The preface promises built-in tools, debugging internals, ASP.NET-specific tooling, mobile simulators/emulators, and extensions; the sampled excerpts do not cover these chapters in depth.
- **Ending (not covered in excerpts)**: Extension authoring (VSIX, .vsct, command files) appears in fragments, but the closing chapters and appendices are not represented.
【Key Takeaways】
- **Installation is a design decision, not a formality** (Opening): Workload selection determines which templates, languages, and tools you get, so choosing deliberately saves later friction.
- **.NET 6 targets developer velocity** (Early): Hot Reload and a faster inner loop let you edit running code without restarts, which changes how you iterate.
- **Cross-platform time handling gets real APIs** (Early): New `TimeOnly` and IANA/Windows time-zone conversion methods address a long-standing gap between Windows and Linux/macOS behavior.
- **C# fundamentals are treated as prerequisite knowledge** (Early): The language chapter reviews variables, constants, arrays, collections, and control flow rather than teaching programming from scratch.
- **The IDE is a collection of specialized windows** (Middle): Solution Explorer, Properties, Toolbox, JSON outline, and data-source wizards each solve a distinct task; knowing which to reach for is the skill.
- **IntelliCode augments, not replaces, IntelliSense** (Middle): Classic features like Parameter Info and Quick Info remain the baseline; IntelliCode adds context-based inline suggestions after you opt in and train a model.
- **The same C# logic spans desktop, web, and mobile IDEs** (Middle): Examples repeat across Windows Forms, ASP.NET, and Xamarin.Forms, showing that platform choice changes tooling more than core code.
- **Extensions are approachable** (Middle): A basic VSIX walkthrough shows how to add a menu command and edit the `.vsct` file, demystifying IDE customization.
【Reading Tips】
- **Skim the C# chapter if you already code**: Use it as a terminology check, not a tutorial; spend the saved time on the IDE and .NET 6 chapters.
- **Deep-read the installation and workload chapter once**: It shapes everything later, especially if you work across web, desktop, and mobile.
- **Treat tool chapters as reference**: Debugging windows, Toolbox sections, and data-source wizards are best consulted when you hit a specific task.
- **Try IntelliCode hands-on**: The value only appears after training on your own codebase; reading about it is less useful than enabling it.
- **Watch for version drift**: The book targets .NET 6 and C# 9-era features; verify menu paths and APIs against your installed version.
【Coverage Limits】
This guide is based on stratified excerpts covering roughly the first half of the book; later chapters on debugging internals, ASP.NET tooling, mobile emulators, and extensions are only partially represented, so their depth cannot be fully assessed.
Passage locations
Page 9
ter 8 digs into tools dedicated to the ASP.NET environment. Chapter 9 explains the need for simulators, emulators and tools that help with creating beautiful...
View in text
Excerpt 2
contains all the controls, or Tools, that we can add to our Form, Web Page or Mobile screen. The .NET Framework Class Library exposes a set of APIs and types...
View in text
Excerpt 3
else if clauses, but it is just simpler and easier to write. Here is the same example as above, but just using a switch statement: string Password = “BpB”; s...
View in text
Excerpt 4
ggingIn(object sender, LoginCancelEventArgs e) { if (Login1.UserName == “OJ” && Login1.Password == “BpB”) { Login1.TitleText = “Welcome Back”; } else { Login...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
Loading recommended books...
Failed to load, please try again later
Tip the Site
Scan the WeChat Pay or Alipay code to tip. No login required.
WeChat Pay
Alipay