How to do it...

  1. Open Visual Studio 2017.
  2. Now, open the solution from the previous recipe. Click File | Open | Open Project/Solutionor press Ctrl + Shift + Oand select the Chapter10.Logging solution. 
  1. Press Ctrl + Shift + B for a quick build to check that everything is fine. 
  2. The Solution Explorer should look like this:
  1. Now, double-click on the LoggerDemo.cs label to open the code window.
  2. Scroll down until you reach the WriteLog() method.
  3. Now, as shown in the following, click on the gray bar on the left side of the code window to add a debug point:
  1. Again, click on the Program.cs tab.
  2. Press F5 to debug the code.
  3. As you can see, the cursor will stop at the debugging point:
  1. Now, move your mouse pointer to the message parameter of the WriteLog() method:
  1. Now, you can see what is stored inside that variable.
  2. Click on the small green arrow as highlighted in the following:
  1. You should see that the debug point jumps to the logFile.WriteLine method.
  2. On the right-hand side of the screen, you should see the Diagnostics Tools window:
  1. Also, at the bottom, you should see the Watch windows and the Call Stack window:
  1. Now, stop debugging by pressing Shift + F5.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.156.250