Précédent   Forum du club des développeurs et IT Pro > Dotnet > Développement Web avec .NET > Windows Azure
Windows Azure Forum d'entraide sur la plateforme de Cloud Computing Windows Azure
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 02/01/2012, 18h26   #1
ybrunet
Invité de passage
 
Inscription : mai 2010
Messages : 4
Détails du profil
Informations forums :
Inscription : mai 2010
Messages : 4
Points : 1
Points : 1
Par défaut Installation d'un service Windows dans une tâche de démarrage

Bonjour à tous,

J'essaye d'installer un service Windows lors du déploiement d'un rôle sur Azure mais cela ne fonctionne pas.

Pour déclencher l'installation du service j'ai paramétré une tâche de démarrage dans le fichier DefinitionService.csdef :

Code xml :
1
2
3
4
 
    <Startup>
      <Task commandLine="GNetCalcServices\AzureInstall.cmd" executionContext="elevated" taskType="background" />
    </Startup>

Le fichier cmd contient les lignes suivantes :
Code batch :
1
2
3
4
 
set here=%~dp0%
"%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "%here%GNetCalcServices.exe"
NET START GNetCalcServices

Dans mon fichier de log, j'ai les informations suivantes :

Code :
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
 
E:\approot\bin>"D:\windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "E:\approot\bin\GNetCalcServices\GNetCalcServices.exe" 
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.4016
Copyright (c) Microsoft Corporation.  All rights reserved.
 
 
Running a transacted installation.
 
Beginning the Install phase of the installation.
See the contents of the log file for the E:\approot\bin\GNetCalcServices\GNetCalcServices.exe assembly's progress.
The file is located at E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog.
Installing assembly 'E:\approot\bin\GNetCalcServices\GNetCalcServices.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = E:\approot\bin\GNetCalcServices\GNetCalcServices.exe
   logfile = E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog
Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
 
An exception occurred during the Install phase.
System.InvalidOperationException: Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
 
The Rollback phase of the installation is beginning.
See the contents of the log file for the E:\approot\bin\GNetCalcServices\GNetCalcServices.exe assembly's progress.
The file is located at E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog.
Rolling back assembly 'E:\approot\bin\GNetCalcServices\GNetCalcServices.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = E:\approot\bin\GNetCalcServices\GNetCalcServices.exe
   logfile = E:\approot\bin\GNetCalcServices\GNetCalcServices.InstallLog
Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to create an instance of the GNetCalcServices.ProjectInstaller installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
The inner exception System.IO.FileNotFoundException was thrown with the following error message: Could not find file 'E:\approot\bin\App.InstallConfig.xml'..
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.
 
The Rollback phase completed successfully.
 
The transacted install has completed.
The installation failed, and the rollback has been performed.
 
E:\approot\bin>NET START GNetCalcServices 
The service name is invalid.
Il semblerait que l'installUtil.exe recherche le "App.InstallConfig.xml" au mauvais endroit mais je ne trouve pas comment spécifier le chemin.

De plus, le script fonctionne très bien quand je l'exécute manuellement.

Merci d'avance pour vos réponses.
ybrunet est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/01/2012, 15h15   #2
ybrunet
Invité de passage
 
Inscription : mai 2010
Messages : 4
Détails du profil
Informations forums :
Inscription : mai 2010
Messages : 4
Points : 1
Points : 1
J'ai résolu mon problème en modifiant une ligne dans le fichier cmd :

Code batch :
1
2
3
4
5
6
7
8
 
set here=%~dp0%
 
REM On se place dans le répertoire où se trouve le script
cd %here%
 
"%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "%here%GNetCalcServices.exe"
NET START GNetCalcServices
ybrunet est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 19h37.


 
 
 
 
Partenaires

Hébergement Web