How I solved this problem was by using Remote Object.
My Windows Service basically hosts the Remote Object as a Singleton and
inside the Remote Object all work occurs.
Follow this Walkthrough
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet11272001.asp
But change OnStart to the following :
Protected Overrides Sub OnStart(ByVal args() As String)
Try
mTcp = New Tcp.TcpChannel(8085)
ChannelServices.RegisterChannel(mTcp)
Catch
System.Diagnostics.EventLog.WriteEntry("DistService", _
"Failed to register tcp channel " & _
Err.Description, EventLogEntryType.Error)
End Try
Try
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(DistObjects.HomeService), "HomeService", _
WellKnownObjectMode.Singleton)
Catch
System.Diagnostics.EventLog.WriteEntry("DistService", _
"Failed to register well known service type " & _
Err.Description, EventLogEntryType.Error)
End Try
End Sub
(i.e. : WellKnownObjectMode.SingleCall to WellKnownObjectMode.Singleton)
If there is otherways of doing what Mr Lindtr'o'm asks for I would also be
interested.
Best Wishes,
Farek
[quoted text, click to view] "Henrik Lindstr?m via .NET 247" wrote:
> I have created a windows service that I want to monitor. I know you can use the "ServiceController" class for this, but is it possible to return custom information from the service, it seems like the "ExecuteCommand()" does not support this. For example, I want info like how many rows has been processed by the service, etc.
>
> Thanks,
> /Henrik
>
> -----------------------
> Posted by a user from .NET 247 (
http://www.dotnet247.com/)
>
> <Id>CV8kn4RcC0+h4I/AXgXu6w==</Id>