I have below piece of code in c# and it's trying to create custom event log ,event source if it does not exist in the event viewer.
Now I don't want custom event log instead it should write entries into "Application" category (log) in the event viewer.So in the below code, if myresponse is null then it should write error msgs to "Application" category (with no custom event source ).I know by default, Windows Event Viewer places log error messages generated by applications into "Application" log. In the below code ,how should I achieve ?
if (myresppnse == null)
EventLog.WriteEntry("Demo", "Error occured");
Thanks in Advance