Code seems not to execute in Windows service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Helmut

    Code seems not to execute in Windows service

    I have a strange problem in my dotnet Windows service:

    I have developed a service, using the core of the "windows service
    sample" found all over the net. Its like:

    ....

    ############
    Protected Overrides Sub OnStart(ByVal args() As String)

    ....
    ..Do some init stuff ..
    ....
    'initialize a timer
    JobTimer.Interv al = 10000 '10 sec
    JobTimer.Enable d = True
    ....

    End Sub
    ############

    In my timer - eventhandler function the first statement is to post "Hi
    im there". For different reasons i use the "old" adodb - COM classes
    to access my database. So i have added adodb (V2.7) in the reference
    dialog to my project.

    ############
    Private Sub JobTimer_Elapse d(...) Handles JobTimer.Elapse d
    m_LogFile.Write Line("Hello World")
    m_LogFile.Flush ()

    ...
    Dim rs As ADODB.Recordset
    rs = New ADODB.Recordset ()

    ...

    End Sub
    ############

    So far so good - the code works fine on my (win2000) system and on
    another system (where dotnet-studio is installed as well).

    B U T - deploying it to a naked (win2000) system where only my exe and
    the dotnet-runtime (and of course MDAC27) is installed something
    strange happens:

    It seems that the whole timer-eventfunction does not execute. The
    first WriteLine does not come out. If I comment out the "rs = new
    ADODB.Recordset ()" line, the logmessages come out again. Also if I
    replace the "new" command by a "CreateObje ct" command the logmessages
    are displayed.

    Even if the logmessages are not displayed, the service stayes allive
    (it reacts proper to the SCM commands). There are no messages in event
    log.


    What am I doing wrong?
    Helmut
Working...