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
web.config:
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
System, Version=2.0.0.0, 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=8.0.0.0, 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
Replies
Know the answer? Post it — somebody with the same question will find it here.