Click here to Skip to main content
15,885,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm using WIN 7 OS and VS 2003. I've downloaded a windows service project from the remote server and installed it successfully in my system using installutil.exe. I'm able to start and stop the service now. But I couldn't debug the service. I've tried Debug -> Processes -> Attach. Even then I'm getting the following error.

"Windows Service Start Failure

Cannot start service from the command line or a debugger. A windows service must be first installed (using installutil.exe) and then started with the Server explorer, Windows Services Administrative tool or the NET START command."

I wanna insert a breakpoint in the onStart() method to understand the program logic. I'm a beginner in .NET.

Can you please help me in debugging the service?



Thanks in advance..

Vanathi
Posted
Updated 12-Apr-17 20:54pm

If you simply want to understand the program logic you could simply run it as a normal application instead of a service.

Here is a nice example of how it can be done:
http://www.codeproject.com/KB/dotnet/DebugWinServices.aspx[^]

Good luck!
 
Share this answer
 
v2
You might also want to check this tip/trick out:

Windows Service Gotcha or Test Your Code Regardles[^]

I don't know if this is what your problem is, but it wouldn't hurt to make sure the appropriate name is used in all the right places.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900