Microsoft Exception Block problem with creating a text file in .net

  • Thread starter Thread starter Sri
  • Start date Start date
S

Sri

I have a simple Web Application hosted on IIS. In this appliaction I
am trying to use Microsoft Exception Blocks. It is giving giving me
some problem in creating a file on the path specified in my
web.config. I tried giving different paths but didnt get any success.
The web.config looks like:
<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,
Microsoft.ApplicationBlocks.ExceptionManagement" />
</configSections>

<exceptionManagement mode="on">
<publisher assembly="TestWeb"
type="TestWeb.ExceptionPublisher" FileName="D:\WebErrorLog.txt" />
<!-- also tried D:\\WebErrorLog.txt -->
</exceptionManagement>

I am able to read web.config but the ExceptionPublisher class throws
an exception "Access to the path D:\WebErrorLog.txt is Denied.

My OS is WinXP, .net framework 1.1. Please give me some solution as
its needed in urgent basis. This approach works fine in windows form
not in web form... very weird. Thanks in advance.
 
I am able to read web.config but the ExceptionPublisher class throws
an exception "Access to the path D:\WebErrorLog.txt is Denied.

My OS is WinXP, .net framework 1.1. Please give me some solution as
its needed in urgent basis. This approach works fine in windows form
not in web form... very weird. Thanks in advance.

You must ensure that the user account the ASP.NET application runs as has
sufficient rights to access the file. Unless you have change the security
settings, your application runs as ASPNET on Windows XP.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
 
thanks a lot for the reply. I was able to solve it with the same
solution u gave. thanks a lot.
 
Back
Top