我真的特林在Windows 7 X64的System.Security.SecurityException C#2.0的Windows服務
安裝我的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
此服務不僅是我,如果我能解決這個問題,就解決了任何其他計算機的計算機?
謝謝
您是否正在使用屬於管理員組的成員帳戶使用提升的權限執行批處理文件? – HackedByChinese
感謝您的重播我運行批處理文件以管理員身份運行,並得到此錯誤>>在使用intaallation時發生異常:system.io.filenotfoundException:無法加載文件或程序集文件:// c:\ windows \ system32 \ ConsoleApplication5。 exe或其依賴項之一。系統找不到指定的文件 –
您可能右鍵單擊並選擇以管理員身份運行。這基本上是以新用戶的身份登錄,更改當前的工作目錄。嘗試打開一個新的CMD窗口,以管理員身份提升,然後導航到安裝目錄並執行批處理文件。 – HackedByChinese