Fixing leftover debug code
Debugging and testing your code is part of an overall cycle of building an ASP.NET Core web application. The .NET platform offers a wide array of libraries and components for debugging, including diagnostics and tracing effectively. However, it is a bad practice for developers to leave debugging code as-is and neglect to remove it from the repository or add conditional checks, thus leading to unnecessary code being deployed in production.
In this recipe, we will learn how to ensure that environment validation is applied to verify whether the necessary debugging methods are called.
Getting ready
We will be using the Online Banking app we used in the previous recipe. Using Visual Studio Code, open the sample Online Banking app folder at \Chapter13\leftover-debug-code\before\OnlineBankingApp\
.
How to do it…
Let's take a look at the steps for this recipe:
- From the starting exercise folder, launch Visual Studio Code by typing...