I follow this question in c# the code that I put in the designer shared sub main was:
#If DEBUG Then
Dim servicio As New CopyFileWorkManagerService
servicio.OnStart(Nothing)
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite)
#Else
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
ServicesToRun = New System.ServiceProcess.ServiceBase() {New Service1}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
#End If
everything debugs well until this line: AddHandler oTimer.Elapsed, AddressOf Me.oTimer_Elapsed
Private Sub New()
InitializeComponent()
log4net.Config.XmlConfigurator.Configure()
oTimer = New Timer(My.Settings.Intervalo)
Debugger.Break()
AddHandler oTimer.Elapsed, AddressOf Me.oTimer_Elapsed
End Sub
the method Private Sub oTimer_Elapsed(sender As Object, e As ElapsedEventArgs)
does not debug!!
what I´m doing wrong?