Installer C# Service sur Windows Serveur (Accès Refusé)
J'ai créé un C# service. Maintenant je veux installer ce service sur Windows Server 2008 R2.
Je suis l'aide de la InstallUtil de commande pour installer le service. J'ai ouvert l'invite de commande en tant qu'administrateur.
Le service doit s'exécuter comme un certain utilisateur, donc j'ai mis le compte d'utilisateur sur le Service programme d'installation.
Lorsque je lance la commande, j'obtiens une erreur:
Une exception s'est produite lors de l'Installation de la phase:
System.ComponentModel.Win32Exception: Access Denied
.
Voici le fichier de log:
Installing assembly 'C:\Service\MyService.exe'.
Affected parameters are:
logtoconsole =
logfile = C:\Service\MyService.InstallLog
assemblypath = C:\Service\MyService.exe
Rolling back assembly 'C:\Service\MyService.exe'.
Affected parameters are:
logtoconsole =
logfile = C:\Service\MyService.InstallLog
assemblypath = C:\Service\MyService.exe
An exception occurred during the Rollback phase of the System.ServiceProcess.ServiceProcessInstaller installer.
System.NullReferenceException: Object reference not set to an instance of an object.
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.
Voici ce qui est affiché sur l'invite de commande:
Beginning the Install phase of the installation.
See the contents of the log file for the C:\Service\MyService.exe assembly's progress.
The file is located at C:\Service\MyService.InstallLog.
Installing assembly 'C:\Service\MyService.exe'.
Affected parameters are:
logtoconsole =
logfile = C:\Service\MyService.InstallLog
assemblypath = C:\Service\MyService.exe
An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: Access Denied
at System.ServiceProcess.ServiceProcessInstaller.OpenSecurityPolicy()
at System.ServiceProcess.ServiceProcessInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.AssemblyInstaller.Install(IDictionary savedState)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Service\MyService.exe assembly's progress.
The file is located at C:\Service\MyService.InstallLog.
Rolling back assembly 'C:\Service\MyService.exe'.
Affected parameters are:
logtoconsole =
logfile = C:\Service\MyService.InstallLog
assemblypath = C:\Service\MyService.exe
An exception occurred during the Rollback phase of the System.ServiceProcess.Ser
viceProcessInstaller installer.
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
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.
Est-ce que qqn sait ce que je dois faire pour installer le service?
Il n'existe pas de code spécifique dans le programme d'installation.
J'ai maintenant créé un nouveau projet de service dans Visual Studio et a tenté d'installer ce service sur le serveur. J'ai eu le même message d'erreur.
Avez-vous démarrer l'invite de commande avec des autorisations élevées? Le
Run as Admin
option lorsque vous cliquez droit sur elle.Oui j'ai ouvert l'invite de commande avec des autorisations élevées.
OriginalL'auteur Alexander | 2013-03-11
Vous devez vous connecter pour publier un commentaire.
J'ai pu enfin installer le service. J'étais connecté sur le serveur dans un rôle appelé l'admin du serveur. Mon Administrateur ajouté mon compte au groupe administrateurs local du serveur. Après cela, j'ai pu installer le service. Il coutures comme l'Administrateur du serveur de compte, que j'ai utilisé pour ouvrir une session dans le système n'ont pas les droits administrateur.
Merci pour votre aide.
OriginalL'auteur Alexander
Vous n'avez vraiment pas donner tous les détails de votre service, et je suis incapable de commenter directement sur votre post mais vous pouvez essayer de ce lien
Le résumé de ce est de vérifier et de vous assurer que vous utilisez la bonne 32/64 bits installutil.exe et pour vérifier votre module de fusion ne sont pas à l'origine du problème.
Peut-être une meilleure description de votre service d'aide? Le service de l'installer correctement sur votre machine locale plutôt que sur le serveur?
OriginalL'auteur David
Ce Problème est dû à la Sécurité, Mieux vaut ouvrir l'invite de commandes à EXÉCUTER en tant QU'ADMINISTRATEUR et installez votre Service, il vous résoudre votre problème certainement
OriginalL'auteur radhason power