1

I built the very simple Windows service and installer outlined in this article:

https://msdn.microsoft.com/en-us/library/aa984464%28v=vs.71%29.aspx

It seems to have built and installed fine, but when I try to start the service I get an unhandled security exception, which states "{"The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security."}" on the following snippet in the Sub New() subroutine:

If Not EventLog.SourceExists("MySource") Then
    EventLog.CreateEventSource("MySource", "MyNewLog")
End If

Per some articles I've found, I've added read permissions for NETWORK SERVICE account to the Security branch and parent EventLog branch in the registry, but I still get the same error. Does anyone see the problem?

Thanks in advance for any help you may provide! Mike

Mike
  • 417
  • 7
  • 28

1 Answers1

0

Create a new key and string value like this;

Key= HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\<Your app name>\
String EventMessageFile value=C:\Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll
CryptoJones
  • 734
  • 3
  • 11
  • 33