Link to home
Create AccountLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

Debug Windows Service program in C#

Hello Experts,
I want to Debug a  Windows Service program.  Any idea how can I do that?  When I do it by hitting F5, it works till a point.  After that I get the attached message.  Please help.  Thank you in advance.

Thank you!
DebugWindowsService.png
Avatar of ste5an
ste5an
Flag of Germany image

It depends on the concrete code and situation..

I develop service code as a class library. Thus allows to use unit test and to create a console application to test the code.

Also use a loging framework like EntLib Logging or  log4net. And https://support.microsoft.com/en-us/kb/815788traces are also an option.
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Hello ste5an,
Thank you!  Do you have any sample code?

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of Lucas
Lucas
Flag of Switzerland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thank you Lucas.  That worked.