My.Log.Writeexception not writing to Application Event Log.

My.Log.Writeexception not writing to Application Event Log.

Post by VG9tIFdpbm » Sun, 22 Jan 2006 03:41:02

I am having a problem with getting My.Log.WriteException to write to the
Event Log in ASP.Net 2.0 with a web service.

When an error occurs, My.Log.WriteException doesn't log anything to the
Event Log. Played around with it and ended up adding the following listeners
to catch and write to the event log by adding the following code in the

<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">

<add name="FileLog"/>

<!-- Uncomment the below section to write to the Application Event
Log -->
<add name="EventLog"/>

<add name="DefaultSwitch" value="Information" />

<add name="FileLog"
Microsoft.VisualBasic, Version=, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
<!-- Uncomment the below section and replace APPLICATION_NAME with the
name of your application to write to the Application Event Log -->
<add name="EventLog" type="System.Diagnostics.EventLogTraceListener,
System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
initializeData="My Web Service"/>


Now My.Log.WriteException will work on my dev machine and write to the event
log. But when I deploy to the web server and an error occurs, it doesn't log
the error and it passes back the following error to me:

Server was unable to process request. ---> Exception has been thrown by the
target of an invocation. ---> Could not create
Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic,
Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL. ---> Access to the path 'C:\Documents and
Settings\Default User.WINDOWS\Application Data\Microsoft Corporation\Internet
Information Services\6.0.3790.1830' is denied.
TextFile_Module.CreateTextFile - path and text file

For more information, see Help and Support Center at

I am running XP PRO x64, VS 2005 Final release, Latest .Net Framework 2.0.
The server is running Win 2003, IIS 6.0, and latest .Net 2.0 Framework.

Thanks for the help,
Tom Wingert

1. Event ID 4100 or Event ID 4356 is logged in the application event log

2. how to get powershell to write to event log or write a log file?

I have a script using


I would like to have a TXT file outputed to say that the scrip ran succesfull.

Something like
remove-item C:\temp -vervbose
Echo the file removal was successful | C:\logs\removal.log
copy-item C:\temp -destination D:\temp
echo the file copy was successful | C:\logs\copy.log

All i am trying to do is verify that the date stamps on the copied files
have changed or that the files are deleted and then are written to the new
location and that succeeded.

If i could do this with an eventlog event that would be great as well and
probably preferred.

any help?

3. WinCE Log in event log is the same as Application Log

4. Application Event Log no Longer logs events

5. ISAPI Application error does not log to "application log"

6. ISAPI Application error does not log to application log.

7. How do i write IIS log into Window Event Log

8. ASP Problem: "IIS log failed to write entry" in Event Log

9. Detect the latest Event log occcurence of a particlar Event ID in the Event log

10. event id 10005 logged in applications logs - ?

11. The following error is being logged every 5 seconds in the application event log

12. Lock against application event log prevent app log from being read

13. Error while installing Logging Block Event Schema for the Application Logging block.

14. event id 10005 logged in applications logs

15. windows Vista Event Logs access through WMI ( Applications and Services Logs)