Visual Studio 2019 Tricks and Techniques
eBook - ePub

Visual Studio 2019 Tricks and Techniques

A developer's guide to writing better code and maximizing productivity

  1. 386 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Visual Studio 2019 Tricks and Techniques

A developer's guide to writing better code and maximizing productivity

About this book

Harness the full power of the Visual Studio IDE to take your coding skills to the next level by learning about IDE productivity practices and exclusive techniques

Key Features

  • Increase your productivity by leveraging Visual Studio 2019's improvements and features
  • Explore powerful editing, code intelligence, and source code control features to increase productivity
  • Delve into VS's powerful, untapped features such as custom project templates and extensions

Book Description

Visual Studio 2019 (VS 2019) and Visual Studio Code (VS Code) are powerful professional development tools that help you to develop applications for any platform with ease. Whether you want to create web, mobile, or desktop applications, Microsoft Visual Studio is your one-stop solution. This book demonstrates some of the most sophisticated capabilities of the tooling and shows you how to use the integrated development environment (IDE) more efficiently to be more productive.

You'll begin by gradually building on concepts, starting with the basics. The introductory chapters cover shortcuts, snippets, and numerous optimization tricks, along with debugging techniques, source control integration, and other important IDE features that will help you make your time more productive. With that groundwork in place, more advanced concepts such as the inner workings of project and item templates are covered. You will also learn how to write quality, secure code more efficiently as well as discover how certain Visual Studio features work 'under the hood'.

By the end of this Visual Studio book, you'll have learned how to write more secure code faster than ever using your knowledge of the extensions and processes that make developing successful solutions more enjoyable and repeatable.

What you will learn

  • Understand the similarities and differences between VS 2019 and VS Code
  • Get to grips with numerous keyboard shortcuts to improve efficiency
  • Discover IDE tips and tricks that make it easier to write code
  • Experiment with code snippets that make it easier to write repeating code patterns
  • Find out how to customize project and item templates with the help of hands-on exercises
  • Use Visual Studio extensions for ease and improved productivity
  • Delve into Visual Studio's behind the scene operations

Who this book is for

This book is for C# and.NET developers who want to become more efficient and take advantage of features they may not be aware of in the IDE. Those looking to increase their productivity and write quality code more quickly by fully utilizing the power of the Visual Studio IDE will also find this book useful.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere β€” even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Visual Studio 2019 Tricks and Techniques by Paul Schroeder,Aaron Cure in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C#. We have over one million books available in our catalogue for you to explore.

Information

Section 1: Visual Studio IDE Productivity Essentials

This section provides the foundational knowledge all developers using Visual Studio should know in order to improve their productivity. Beyond the basics, some of the lesser-known features of the integrated development environment (IDE) are uncovered. Numerous hands-on exercises dive deep into how Visual Studio works behind the scenes.
This section has the following chapters:
  • Chapter 1, Flavors of Visual Studio
  • Chapter 2, Keyboard Shortcuts
  • Chapter 3, IDE Tips and Tricks
  • Chapter 4, Working with a Repository
  • Chapter 5, Working with Snippets
  • Chapter 6, Database Explorers
  • Chapter 7, Compiling, Debugging, and Version Control

Chapter 1: Flavors of Visual Studio

Microsoft Visual Studio is an Integrated Development Environment (IDE) from Microsoft. Over its more than twenty-year history, it has been used by developers to develop all kinds of computer programs, web applications, web APIs, and mobile apps. A 2019 survey by Stack Overflow found Visual Studio and its cousin, Visual Studio Code (VS Code), to be two of the most popular development environments among all survey respondents (see https://insights.stackoverflow.com/survey/2019):
Figure 1.1 – Stack Overflow 2019 survey
Figure 1.1 – Stack Overflow 2019 survey
Note on Stack Overflow 2020 survey results
Although Stack Overflow's 2020 survey results were available at the time of writing, they did not seem to include the same specific question on development environments.
Visual Studio provides robust coding and debugging capabilities as well as extensive integration for deployment and source control needs. You can use it to program anything from a desktop business application, to a web site, mobile application, or Unity game.
If you are new to programming or .NET development, it is important to understand that there are several options to consider before starting. This chapter's primary focus is to cover some key factors you should consider when deciding which product "flavor" of Visual Studio is right for you, including the following:
  • Primary operating system (Windows, macOS, or Linux)
  • Target framework (.NET full framework, .NET Core)
  • Team size and budget
  • Application type (Windows, web, mobile, server, or console)
  • Cross-platform portability requirements
  • Chosen programming language (such as C#, VB, Python, Ruby, or NodeJS)
The reason why we must examine the aforementioned points in detail is because Microsoft has combined what are actually multiple, separate, products under a single marketing umbrella. This can make choosing between these products confusing and so we will take a moment to clearly identify each version, differentiate their features, and provide some guidance on which version may be best for your purposes.

Technical requirements

The code for this book is available on GitHub at: https://github.com/PacktPublishing/Visual-Studio-2019-Tricks-and-Techniques/tree/main/.
Please check the following link for CiA videos: http://bit.ly/3oxE5QM.

Quick reference cheat sheet

With so many options, how does a developer know which version to use? The following is a list of simplified suggestions to help you choose a particular flavor:
  • If you are using a PC and are brand new to software development, start with VS 2019 Community.
  • If you are using a PC as an experienced developer, or have a well-funded company footing the bill, consider the VS 2019 Professional or VS 2019 Enterprise editions.
  • If you're primarily a web developer planning to use NodeJS and TypeScript, try VS Code.
  • If you're developing cross-platform iOS/Android mobile apps, consider using VS for Mac.
    Have you already decided on which version to use?
    If you have already figured out which version of Visual Studio is right for you, then feel free to skip this chapter's content. Alternatively, if you are an experienced developer, skim this material looking for new tidbits, such as GitHub Codespaces.
For those readers that need more information to decide, let's begin digging into the details of the most long-lived product flavor, Visual Studio for Windows.

Visual Studio 2019 (Windows)

Let's start with Visual Studio 2019 (VS 2019), a Windows-based IDE (pronounced AYE-dee-ee). Some people will refer to this product as the full version. This version only runs on Windows (not cross-platform), but it does support both .NET "full framework" and .NET Core (cross-platform) project targets. Something all versions of Visual Studio do exceptionally well is work with diverse programming languages (including C, C++, Visual Basic. NET, C#, F#, JavaScript, TypeScript, Python, Ruby, and Node.js).
Different tiers of features are offered, depending on your needs and budget. Current versions of VS 2019 include a free Community edition as well as paid Professional, Enterprise, and Test Professional versions. The Community and Professional editions are nearly identical when it comes to operational features and, for most development tasks, any version of Visual Studio will work.
The Community version is depicted in the screenshot that follows and you will find virtually no difference between its appearance and that of the other versions:
Figure 1.2 – VS 2019 Community – Windows
Figure 1.2 – VS 2019 Community – Windows
Even with multiple options, choosing a Visual Studio edition is much easier today than in the past. Previously, certain project types could only be loaded in one edition or another, and many add-ins would not run in certain editions. Complex licensing issues compounded these problems, making it more difficult to choose.
Today, even the free Community edition is a powerful environment with much to offer. Many of the popular features, such as peeking at definitions, multi-targeting of release targets, and refactoring are supported in all editions.
More succinctly, the major versions of VS 2019 are as follows:
  • Community – Free for students, open source contributors, and individuals
  • Professional – The best choice for small teams
  • Test Professional – An option for dedicated Quality Assurance (QA) roles
  • Enterprise – Offers extra features (mentioned later in this chapter) and works well for teams of any size
In the past, the Community version, originally labeled "Express," was a very limited version that allowed only basic application development but would not allow for particular target types (such as Visual Studio plugins), and would also not allow a number of plugins to run. While some of these limitations seemed minor, they were enough to create negative perceptions of the platform among some developers and sour development community sentiment on the Community version. In recent years, Microsoft has removed many of the original restrictions and enabled so much functionality in this version that the experience is now very similar to the Professional version.
Traditionally, the Professional version was the lowest tier version for "true" developers. Because of the limitations of other versions, this was the only way to do "actual" development. This version tier is (and always has been) a full-featured IDE with all the bells and whistles you would expect in a professional development tool.
A key difference is that VS 2019 Community is free, while the Professional version retails for about $1,199 for the first year's subscription and $799 annually for renewal thereafter. However, there are license restrictions that limit use of Visual Studio Community to teams of less than five developers. Also, it cannot be used by commercial organizations with over $1 million US dollars in annual revenue.
For those whose focus is purely QA, and not development, Test Professional is another option to consider. It provides an integrated testing toolset for QA ...

Table of contents

  1. Visual Studio 2019 Tricks and Techniques
  2. Why subscribe?
  3. Preface
  4. Section 1: Visual Studio IDE Productivity Essentials
  5. Chapter 1: Flavors of Visual Studio
  6. Chapter 2: Keyboard Shortcuts
  7. Chapter 3: IDE Tips and Tricks
  8. Chapter 4: Working with a Repository
  9. Chapter 5: Working with Snippets
  10. Chapter 6: Database Explorers
  11. Chapter 7: Compiling, Debugging, and Versioning
  12. Section 2: Customizing Project Templates and Beyond
  13. Chapter 8: Introduction to Project and Item Templates
  14. Chapter 9: Creating Your Own Templates
  15. Chapter 10: Deploying Custom Templates
  16. Section 3: Leveraging Extensions for the Win
  17. Chapter 11: Overviewing Visual Studio 2019 Extensions
  18. Chapter 12: Overviewing VS Code Extensions
  19. Chapter 13: CodeMaid is Your Friend
  20. Chapter 14: Be Your Team's Hero with CodeGenHero
  21. Chapter 15: Secure Code with Puma Scan
  22. Appendix
  23. Other Books You May Enjoy