IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Windows Discussion :

Problème insttautill : le service existe déjà


Sujet :

Services Windows

  1. #1
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut Problème insttautill : le service existe déjà
    Bonjour à tous,

    Lorsque je veux installer mon service sur mon pc, cette exception se déclare donc l'installation ne fonctionne pas

    System.ComponentModel.Win32Exception : Le service spécifié existe déjà.

    Ceci alros queje que je suis sur que le service n'existe pas.
    Merci,

  2. #2
    Membre expert
    Avatar de GuruuMeditation
    Homme Profil pro
    .Net Architect
    Inscrit en
    Octobre 2010
    Messages
    1 705
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : Belgique

    Informations professionnelles :
    Activité : .Net Architect
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2010
    Messages : 1 705
    Points : 3 568
    Points
    3 568
    Par défaut
    Bizarre. Tu as essayé un installlutil /u nomduservice pour être sûr ?
    Microsoft MVP : Windows Platform

    MCPD - Windows Phone Developer
    MCPD - Windows Developer 4

    http://www.guruumeditation.net

    “If debugging is the process of removing bugs, then programming must be the process of putting them in.”
    (Edsger W. Dijkstra)

  3. #3
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut
    oui oui j'ai essayé et cela me dit que le service n'existe pas.
    Je pense que cela viendrait de mon fichier installer je suis sur visual studio2010, j'ai fait un service sur visual 2012 il fonction.
    Ou sinon si vous connaissez la solution avec 2012 pour faire setup d'installation pour mon service. j'ai essayez avec installshield limited edition mais je n'arrive pas à faire une installation correcte.
    Sinon voici mon code :
    projectinstaller.cs
    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
    40
    41
    42
    43
    44
    45
    46
     
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.Linq;
    using System.ServiceProcess;
     
     
    namespace WindowsService1
    {
        [RunInstaller(true)]
        public partial class ProjectInstaller : System.Configuration.Install.Installer
        {
            public ProjectInstaller()
            {
     
                InitializeComponent();
                ServiceProcessInstaller process = new ServiceProcessInstaller();
                process.Account = ServiceAccount.LocalService;
     
     
                ServiceInstaller serviceAdmin = new ServiceInstaller();
                serviceAdmin.StartType = ServiceStartMode.Automatic;
     
     
                serviceAdmin.ServiceName = "Service3";
                serviceAdmin.DisplayName = "Service3";
                serviceAdmin.Description = "Service3";
     
                Installers.Add(process);
                Installers.Add(serviceAdmin);
            }
     
            private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
            {
     
            }
     
            private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
            {
     
            }
        }
    }
    projectInstallerDesigner.cs

    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
     
    namespace WindowsService1
    {
        partial class ProjectInstaller
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
     
            /// <summary> 
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
     
            #region Component Designer generated code
     
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
                this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
                serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
                // 
                // serviceProcessInstaller1
                // 
                serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalService;
                //serviceProcessInstaller1.Password = null;
                //serviceProcessInstaller1.Username = null;
                serviceProcessInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_AfterInstall);
                // 
                // serviceInstaller1
                // 
                this.serviceInstaller1.ServiceName = "Service3";
                this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
                this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
                // 
                // ProjectInstaller
                // 
                this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                serviceProcessInstaller1,
                this.serviceInstaller1});
     
            }
     
            #endregion
     
            private System.ServiceProcess.ServiceInstaller serviceInstaller1;
        }
    }

  4. #4
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut
    J'ai maintenant trouvé que le .vhost.exe de mon service tourne toujours comment l'arrêter, et pourquoi ce la fait ça?
    Mauvaise piste rien avoir avec ça.

  5. #5
    Inactif  
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Janvier 2007
    Messages
    6 604
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC

    Informations forums :
    Inscription : Janvier 2007
    Messages : 6 604
    Points : 13 314
    Points
    13 314
    Par défaut
    Citation Envoyé par xavpiaf Voir le message
    J'ai maintenant trouvé que le .vhost.exe de mon service tourne toujours comment l'arrêter, et pourquoi ce la fait ça?
    Mauvaise piste rien avoir avec ça.
    Le .vhost est lié à Visual Studio. Visiblement tu as du lancer le programme du service hors du SCM. (mais en bonne logique il aurait du lever une exception dans ce cas).

    Je ne réponds pas aux questions techniques par MP ! Le forum est là pour ça...


    Une réponse vous a aidé ? utiliser le bouton

    "L’ennui dans ce monde, c’est que les idiots sont sûrs d’eux et les gens sensés pleins de doutes". B. Russel

  6. #6
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut
    J'ai supprimé mon projectinstaller et rajouter un nouveua!!Maintenznt l'installation fonctionne par contre lorsque je démarre mon service j'ai un message : " le service windows local a été démarrer puis arrêté automatiquement..."
    Et donc mon service ne démarre pas !!

  7. #7
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut
    J'ai réglé mon problème en changeant LocalService en LocalSystem.
    Je voudrais savoir comment démarrer mon service à la fin de l'installation.

  8. #8
    Membre régulier
    Inscrit en
    Janvier 2008
    Messages
    285
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 285
    Points : 91
    Points
    91
    Par défaut
    Solution :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
            {
     
     
                ServiceController SC = new ServiceController();
                SC.ServiceName = serviceInstaller1.ServiceName;
                SC.Start();
            }

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème sur le service network
    Par GRE_GUY dans le forum Réseau
    Réponses: 4
    Dernier message: 25/11/2006, 23h02
  2. Réponses: 19
    Dernier message: 29/06/2006, 13h11
  3. Problèmes avec les services NT/Windows 2000
    Par newfsch dans le forum API, COM et SDKs
    Réponses: 3
    Dernier message: 02/03/2006, 16h49
  4. Problème avec mon service mysql et PhpMyAdmin
    Par Fixazo dans le forum Outils
    Réponses: 1
    Dernier message: 28/08/2005, 18h02
  5. Problème "The specified service does not exist as an ..
    Par Rimak2 dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 23/05/2005, 21h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo