安装Windows服务时Topshelf抛出错误

时间:2019-07-05 11:57:24

标签: .net windows topshelf

当我尝试安装Windows服务时,出现以下错误。 我已验证该用户帐户具有作为服务登录的权限。 另外,我通过以同一用户身份登录来运行安装。 运行命令

'C:\HostedApps2\Apps\ExceptionDefinition\ABC.Cloud.AMAM.ExDefinition.Api.exe install -e "Development" -u "eeur1@ABC.com" -p "GussMaPs"'

这是例外

The transacted install has completed.
fail: Topshelf.HostFactory[0]
      The service terminated abnormally
System.InvalidOperationException: The installation failed, and the rollback has been performed. ---> System.Component
el.Win32Exception: Access is denied
   at System.ServiceProcess.ServiceInstaller.Install(IDictionary stateSaver)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at Topshelf.Runtime.Windows.HostInstaller.Install(IDictionary stateSaver)
   at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
   at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
   --- End of inner exception stack trace ---
   at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
   at Topshelf.StartParameters.SpWindowsHostEnvironment.InstallService(InstallHostSettings settings, Action`1 beforeI
all, Action afterInstall, Action beforeRollback, Action afterRollback)
   at Topshelf.Hosts.InstallHost.Run()
   at Topshelf.HostFactory.Run(Action`1 configureCallback)
------- End Executable Output -------
  

我已验证的内容:   1.用户帐户有权登录为服务。   2.使用perfmon工具识别错误,但访问被拒绝不会导致结果。

我们所怀疑的是,用于安装服务的用户名与尝试安装该服务的PC属于不同的域。

0 个答案:

没有答案