Set - 4

Question 16 :

Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

Answer :

The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.


Question 17 :

Where is the output of TextWriterTraceListener redirected?

Answer :

To the Console or a text file depending on the parameter passed to the constructor.


Question 18 :

How do you debug an ASP.NET Web application?

Answer :

Attach the aspnet_wp.exe process to the DbgClr debugger.


Question 19 :

What are three test cases you should go through in unit testing?

Answer :

1. Positive test cases (correct data, correct output).
2. Negative test cases (broken or missing data, proper handling).
3. Exception test cases (exceptions are thrown and caught properly).


Question 20 :

Can you change the value of a variable while debugging a C# application?

Answer :

Yes. If you are debugging via Visual Studio.NET, just go to Immediate window.