C# event log | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# event log

Hi guys I’m trying to write a simple event log but i confront with “System.Security.SecurityException: The source was not found...” and i searched a lot but couldn’t find an efficient solution, I really really appreciate if someone help me with that 🙏🏽 I know that the source needed to be created and the key must be registered but what is the key and How should i do that? String source =“DemoTestApplication”; String log = “DemoEventLog”; EventLog demolog=new EventLog(log); demolog.Source=source; demolog.writeEntry(“This is the first message to the log”,EventLogEntryType.Information);

9th Aug 2018, 7:25 AM
Sogand katuzian
1 Answer
0
Is this a Windows event log?
29th Nov 2019, 7:38 AM
SQrL
SQrL - avatar