nerdexam
Microsoft

98-361 · Question #69

You need to debug a Windows Service application by using breakpoints. What should you do?

The correct answer is D. Use the Attach to Process menu in Microsoft Visual Studio. Because a service must be run from within the context of the Services Control Manager rather than from within Visual Studio, debugging a service is not as straightforward as debugging other Visual Studio application types. To debug a service, you must start the service and then…

Understanding Desktop Applications

Question

You need to debug a Windows Service application by using breakpoints. What should you do?

Options

  • AWrite all events to an event log.
  • BSet the Windows Service status to Paused.
  • CImplement the Console.WriteLine method throughout the Windows Service.
  • DUse the Attach to Process menu in Microsoft Visual Studio.

How the community answered

(54 responses)
  • A
    4% (2)
  • B
    19% (10)
  • C
    7% (4)
  • D
    70% (38)

Explanation

  • Because a service must be run from within the context of the Services Control Manager rather than from within Visual Studio, debugging a service is not as straightforward as debugging other Visual Studio application types. To debug a service, you must start the service and then attach a debugger to the process in which it is running. * To debug a service Install your service. Start your service, either from Services Control Manager, Server Explorer, or from code. In Visual Studio, choose Attach to Process from the Debug menu.

Topics

#Windows Service#debugging#Visual Studio attach to process#breakpoints

Community Discussion

No community discussion yet for this question.

Full 98-361 Practice