Re: Windows Services

From: Eric (anonymous_at_discussions.microsoft.com)
Date: 05/17/04


Date: Mon, 17 May 2004 10:06:02 -0700

Hi,

This is what I have in my OnStart :

Try
            EcrireErreur("test")
            'Création des logs s'il n'existe pas.
            If Not Log.SourceExists("FusionDec") Then
                Log.CreateEventSource("FusionDec", "FusionDec")
            End If
            Log.Source = "FusionDec"

            'option du FileSystemWatcher.
            fwFichierFusion.Path = "c:\Test2\"
            fwFichierFusion.Filter = ""
            fwFichierFusion.IncludeSubdirectories = True

            fwFichierFusion.EnableRaisingEvents = True

            'Ajout de l'action évènement.
            AddHandler fwFichierFusion.Created, AddressOf FusionDec

            Log.WriteEntry("FusionDec démarrer avec succès")
Catch ex As Exception
            Debug.WriteLine(Err.GetException.ToString())
            EcrireErreur(Err.GetException.ToString())
            Log.WriteEntry("Erreur lors du démarrage du service : " & vbCrLf & ex.ToString)
End Try

I think it isn't to much in the OnStart() and I can't debug it because it start and few second after it stop.

by the way thanks for trying