Whem I\'m writing a Windows Service and just hit F5 I get the error message that I have to install it using installutil.exe
and then run it.
In practice this me
The best way in my opinion is to use Debug
directive. Below is an example for the same.
#if(!DEBUG)
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
// Calling MyService Constructor
new MyService()
};
ServiceBase.Run(ServicesToRun);
#else
MyService serviceCall = new MyService();
serviceCall.YourMethodContainingLogic();
#endif
Hit F5
And set a Breakpoint
on your YourMethodContainingLogic
Method to debug it.