Bonjour;
Je viens vous poser une question car il s'avère que je ne trouve pas de solution réelle a mon problème : j'ai créé un Services (Via Visual Studio) qui démarre 3 threads lors du onStart.
Les 3 threads sont des boucles; deux sont des boucles d'écoutes TCP la dernière est une tâche s'executant toutes les 10 secondes. Normalement, les thread ne se ferme pas car ils sont dans un "while (true)".
Le soucis, est que j'obtient ce message (qui apparait instantanément.) :
Quand j'ouvre l'observateur d'evenements, voici le log complet que je peux voir : http://befaster.fr/Imgs/Error2.png
Je tiens a préciser qu'en local (Win7 Pro x64 SP1) le service ne s'execute pas :
J'ai suivi à la lettre le "Walkthrough" : http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx
J'utilise bien un installeur, j'ai bien vérifié que les élements créés dans le "ProjectInstaller" ai le même Service Name.
Je sèche complètement.
Voici le code onStart de mon service :
Une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 protected override void OnStart(string[] args) { try { FirstStartRoutine(); TcpServer = new Thread(new ThreadStart(tcpListenerThread)); TcpServer.Start(); PloofLog.WriteEntry("Ploof Tcp Listening : Started successfully", EventLogEntryType.Information); } catch (Exception ex) { PloofLog.WriteEntry("Ploof Tcp Listening : Not started; StackTrace \n : " + ex.ToString(), EventLogEntryType.Error); } try { ThUpdateService = new Thread(new ThreadStart(updateService)); ThUpdateService.Start(); PloofLog.WriteEntry("Ploof Update Tcp Listening : Started successfully", EventLogEntryType.Information); } catch (Exception ex) { PloofLog.WriteEntry("Ploof Update Tcp Listening : Not started; StackTrace \n : " + ex.ToString(), EventLogEntryType.Error); } try { DecrementerService = new Thread(new ThreadStart(decrementerThread)); DecrementerService.Start(); PloofLog.WriteEntry("Ploof DecrementerService : Started successfully", EventLogEntryType.Information); } catch (Exception ex) { PloofLog.WriteEntry("Ploof DecrementerService : Not Started; StackTrace \n : " + ex.ToString(), EventLogEntryType.Error); } }
Merci d'avance.
Partager