Re: Console App runs OK Windows Service Fails

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: mb (anonymous_at_discussions.microsoft.com)
Date: 05/14/04


Date: Fri, 14 May 2004 13:21:05 -0700

Please see the following code snippet. I had the same problem and with this code snippet it works fine. Hope this helps ...

 Protected Overrides Sub OnStart(ByVal args() As String)
        ' Add code here to start your service. This method should set things
        ' in motion so your service can do its work.
        Try

            RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ApplicationBase & "\RemoteServer.config")
            Catch ex As Exception
            EventLog.WriteEntry("Plus App Server: Failed to start the service. Please see the exception details in subsequent log entries..")
            EventLog.WriteEntry(ex.Message)
            While Not IsNothing(ex.InnerException)
                ex = ex.InnerException
                EventLog.WriteEntry(ex.Message)
                EventLog.WriteEntry(ex.StackTrace)
            End While
        End Try
        EventLog.WriteEntry("Plus App Server started successfully.")

    End Sub

Regards
persmb@put this

comcast.net



Relevant Pages

  • Re: How To Create A Gradient Background
    ... Protected Overrides Sub OnPaint ... > Some code snippet would be nice. ... >> Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How To Create A Gradient Background
    ... > Protected Overrides Sub OnPaint ... >> Some code snippet would be nice. ... >>> Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.languages.vb)
  • Re: I need to divide a word
    ... You only have to change this code snippet to the following (everything else ... Dim ii As Integer, value As String, xx As String, yy As String ... >> Dim ii As Integer, value As String, xx As String, yy As String ... >> Regards, ...
    (microsoft.public.access.queries)
  • Re: I need to divide a word
    ... You only have to change this code snippet to the following (everything else ... Dim ii As Integer, value As String, xx As String, yy As String ... >> Dim ii As Integer, value As String, xx As String, yy As String ... >> Regards, ...
    (microsoft.public.access.gettingstarted)
  • Re: Regular expression to read non-commented lines from a file
    ... Mario Winterer wrote: ... > Here's the code snippet that prints all lines that are not comments and ... > The input is a String ... >> from a file which are not comments and do not start with whitespace. ...
    (comp.lang.java.help)