A
Andrew Falanga
Hi,
I'm writing a windows service, that uses a WCF service (the server
side). The WCF service simply opens a TCP port to wait for clients to
connect, etc. I put the Open( ) call in the OnStart( ) function and
likewise the Close( ) call in the OnStop( ) function. This seemed the
proper course when making the windows service (I used the C# template
for this). I used the example on MSDN for making a WCF service, which
is a command line app, and then simply used those calls assuming that
they start and stop the server.
Now, I used MSDN to setup an installer deal and then used
"installutil" to install my service. Lo and behold, my service is
listed in the system services. So, I start it up. This works and I'm
able to run my test driver program against it and everything works. I
tried to stop it and I get an error. Trying to eliminate variables, I
restarted the box and restarted my service (it's manual start). Then,
I stopped it without making any connections. I still got the same
error. The error is:
Could not stop the MyService service on Local Computer. The service
did not return an error.
Now, I'm confused because the OnStop( ) function is defined as
returning type void, i.e. it has no return. So, why is this error
happening? How should I fix it?
Andy
I'm writing a windows service, that uses a WCF service (the server
side). The WCF service simply opens a TCP port to wait for clients to
connect, etc. I put the Open( ) call in the OnStart( ) function and
likewise the Close( ) call in the OnStop( ) function. This seemed the
proper course when making the windows service (I used the C# template
for this). I used the example on MSDN for making a WCF service, which
is a command line app, and then simply used those calls assuming that
they start and stop the server.
Now, I used MSDN to setup an installer deal and then used
"installutil" to install my service. Lo and behold, my service is
listed in the system services. So, I start it up. This works and I'm
able to run my test driver program against it and everything works. I
tried to stop it and I get an error. Trying to eliminate variables, I
restarted the box and restarted my service (it's manual start). Then,
I stopped it without making any connections. I still got the same
error. The error is:
Could not stop the MyService service on Local Computer. The service
did not return an error.
Now, I'm confused because the OnStop( ) function is defined as
returning type void, i.e. it has no return. So, why is this error
happening? How should I fix it?
Andy