Dear Friends,
Greetings.
I am facing a trouble from last couple of weeks. I have created/coded a windows service using VB.NET in Microsoft visual studio 2010 which I am wanting to debug.
I searched many many solutions but could not get anything working with the service I have developed. I also tried to install the service and then attaching the process debugger to my mprogram. Once I am done I tried to add debug ponits, but not worth.
I would like to share more details as follows:
Here s the VB code for service
Public Class pspldemows
Private bln_LogFlag As Boolean
Protected Overrides Sub OnStart(ByVal args() As String)
tmr_mainws.Interval = 1000
tmr_mainws.Enabled = True
End Sub
Protected Overrides Sub OnStop()
End Sub
Private Sub tmr_mainws_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_mainws.Tick
tmr_mainws.Enabled = False
Me.WriteNewLog()
tmr_mainws.Enabled = True
End Sub
Private Sub WriteNewLog()
Try
If True = bln_LogFlag Then
Me.evntlog_mainlog.WriteEntry("pspldemows is alive")
bln_LogFlag = False
ElseIf False = bln_LogFlag Then
Me.evntlog_mainlog.WriteEntry("pspldemows is now willing to die")
bln_LogFlag = True
End If
Catch ex As Exception
Me.evntlog_mainlog.WriteEntry("pspldemows|WriteNewLog():<ERROR>: " & ex.Message)
End Try
End Sub
End Class
As generally required the project installer is also added to it and all the properties of serviceInstaller and serviceProcessInstaller.
To install the project I created a setup for this (as guided by following reference link to create setup), installed the program.
http://myhosting.com/blog/2010/09/creating-windows-service-visual-studio-2010/[
^
When I have seen the services screen, I am able to see the service running, but not able to debug it.I am not getting where I am going wrong.
Guys, please help me out for this.
Your valuable suggestions and replies are appreciated in advance.
Thank you very much.
Regards,
G Nachiket