ASP.net 1.1 writing to Application Log

M

MattB

Hi. I need to start logging my application in the Windows Event Log. I
found some sample code and it works from a Windows Form. So I put it
into my asp.net application and initially had a problem that I found I
just needed to create a registry key as outlined in this kb article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;329291

So now I get a log entry in my event log, and the entry I specified in
the code was: "Invoke called, WebService = False" but in the log I see
all this text, which then ends with what I actually specified in code.

The description for Event ID ( 0 ) in Source ( eCommerce ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. You may be able to use the /AUXSOURCE= flag to retrieve this
description; see Help and Support for details. The following information
is part of the event: Invoke called, WebService = False.

I found some references to other having this issue but no answers.
Anyone know what I need to do to fix this? Thanks!

The code I'm using is this:

Try
'Register the App as an Event Source
If Not objEventLog.SourceExists(AppName) Then

objEventLog.CreateEventSource(AppName, LogName)
End If

objEventLog.Source = AppName

'WriteEntry is overloaded; this is one
'of 10 ways to call it
objEventLog.WriteEntry(Entry, EventType)
Return True
Catch Ex As Exception
Return False
End Try

Thanks,
Matt
 
M

MattB

Ah, I figured it out. In case anyone else is having this problem, I
looked in another .Net application's registry settings in the same
Application Log key and I was missing the following REG_SZ entry:
Name: EventMessageFile
Value: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top