Microsoft
98-361 · Question #210
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
(23 responses)- A9% (2)
- B4% (1)
- C17% (4)
- D70% (16)
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
#debugging#Windows Service#breakpoints#Visual Studio
Community Discussion
No community discussion yet for this question.