Event Log Problem

Hi,

I am trying to test event logging in .net. Here is the sample code

Dim EventLogName As String = "Test"
If (Not EventLog.SourceExists(EventLogName)) Then
EventLog.CreateEventSource(EventLogName, EventLogName)
End If

Dim Log As New EventLog
Log.Source = EventLogName
Log.WriteEntry("Event Log Test", EventLogEntryType.Error)

I am getting this error message "'SourceExists' is not a member of 'EventLog'."

I am not too sure id I am missing a include file or something, I have included " System.Diagnostics" already.

Thanks!

[607 byte] By [codefund.com] at [2008-2-8]
# 1
I resolved this issue. Thanks!
codefund.com at 2007-9-9 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 2
I'm facing similar problem of compiler error in an VC++ service application coding. Could you pl. elaborate on how resoved the issue.
SKrishna at 2007-9-9 > top of Msdn Tech,.NET Development,Common Language Runtime...

.NET Development

Site Classified