Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#: Running and Debugging a Windows Service

I am currently building a Windows Service with C# and I just can't figure out how to debug it.


I am building it and then registering with installutil:

> installutil MusicRepo_FileMonitor.exe

The Commit phase completed successfully.

The transacted install has completed.

And as you can see above, it is supposedly being registered successfully, but I can't find it in services.smc. I have also tried starting the service with net start [ServiceName] but it's telling me The service name is invalid. so I guess it's not finding it.


For the record, I'm on Vista and I'm developing the ws with .Net 3.5


[Update]

Solution

like image 760
Andreas Grech Avatar asked Dec 30 '25 07:12

Andreas Grech


1 Answers

Try Task Manager and see if you see MusicRepo_FileMonitor.exe. If not, then the service is definitely not running.

Alternatively, in Visual Studio, Debug > Attach to Process, check show processes from all users, and see if its there.

like image 150
Robert Koch Avatar answered Dec 31 '25 21:12

Robert Koch