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

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.
 
A

Anders Norås [MCAD]

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/
 
S

sri reddy

thanks a lot for the reply. I was able to solve it with the same
solution u gave. thanks a lot.
 

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

Top