Deploying snippets
In this section, you will learn how to deploy and use the snippet we examined in the previous example. As previously mentioned, one option is to import code snippets using the Code Snippets Manager. A non-standard approach is to simply copy one or more snippet files directly into a subfolder of your Documents\Visual Studio 2019\Code Snippets
directory. If you have a lot of great snippets to share broadly, it is also possible to bundle snippet files into a Visual Studio extension (VSIX file) for easy distribution and installation. That is a bit beyond the scope of this chapter, but instructions on how to do so can be found at https://docs.microsoft.com/en-us/visualstudio/ide/how-to-distribute-code-snippets?view=vs-2019.
Importing a custom snippet
In this example, we are going to import the snippet we examined in the previous example. You will then be able to easily use it in other projects to time how long it takes to execute code within a method. Let's...