I am trying to use eventlogs in my application using C#, so I added the following code
if (!EventLog.SourceExists(\"SomeName\")) EventLog.CreateEventSource(\
Good afternoon, The simplest is that you run vs2019 as an administrator, so when debugging or excute the service, it will run correctly without generating the exception.