-1

I am still trying to install my service so I can test it and have had help in solving the previous errors of System.IO filenotfoundexception

The command I am running is: installutil C:\Dev/Projects/DBBackUpService\DBBackUpService\bin\Debug\DBBackUpService.exe

The error I am returning is exception occurred during the install phase:

System.security.securityException : The source was not found but some or all event logs could not be searched. Inaccessible logs: Security. and then it performs a rollback.

jrbedard
  • 3,662
  • 5
  • 30
  • 34
  • 1
    Modified your path like this:C:\Dev\Projects\DBBackUpService\DBBackUpService\bin\Debug\DBBackUpService.exe – Dil85 Nov 22 '16 at 13:34
  • 1
    This has nothing to do with the SQL language. Please chose another tag. – jarlh Nov 22 '16 at 13:37
  • Split the core of your program into a separate DLL and debug via a referenced console app. You can also use Topshelf to install the same console app as a windows service and use NLog for logging. – Steve Nov 22 '16 at 15:39
  • You must run installutil.exe from an elevated command prompt. So it has sufficient rights to modify the registry. And access the event log. Use the "Run as Administrator" option. – Hans Passant Nov 24 '16 at 15:25

1 Answers1

1

Looks like you are wanting to write information/errors to the system event log. When you service starts up it is trying to see if an Event Log Source already exists with the same name as your sSource.

Only a system administrator has the rights to search all event logs. You need to use a local Admin account when running your service.

If you are concerned about security risks running your service as Admin, you could use a different logging system like NLog.

Woot
  • 1,759
  • 1
  • 16
  • 23