Write into file from a Handler - UnauthorizedAccessException

Posted on 2009-02-09
Last Modified: 2012-05-06

I've a Handler for my web application and try to write to a file:

The response is ever, that I've no rights to write there - UnauthorizedAccessException ...
The path is right in the error message: "C:\inetpub\wwwroot\webapp\test.xml"

How can I solve this problem?

Question by:andre72
    LVL 15

    Accepted Solution

    This is because the ASPNET account and the NETWORK SERVICE account do not have the correct permissions..

    Right click the folder webapp and select properties. Then add all rights to ASPNET and NETWORK SERVICE users

    Author Closing Comment

    Works for me, thanks a lot!

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now