我正在尝试在 Windows 7 x64 上安装我的 Windows 服务
并得到这个错误
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
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.
这是我的MyWindowsServiceInstaller
代码:
var processInstaller = new ServiceProcessInstaller();
var serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.DisplayName = "My Service";
serviceInstaller.StartType = ServiceStartMode.Manual;
serviceInstaller.ServiceName = "My Service";
this.Installers.Add(processInstaller);
this.Installers.Add(serviceInstaller);
我已经设置了我的应用程序名称来启动项目
这是bat文件
@ECHO OFF
REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%
echo Installing MyService...
echo ---------------------------------------------------
InstallUtil /i ConsoleApplication5.exe
echo ---------------------------------------------------
echo Done.
pause
如果我要解决此问题,该服务不仅是我的计算机,它是否会为任何其他计算机解决?
谢谢