?
Solved

Unauthorized access exception

Posted on 2004-10-20
5
Medium Priority
?
1,153 Views
Last Modified: 2012-06-27
Hi,

I'm trying to delete a file using System.IO.File.Delete(file).. however I keep getting the error :

System.UnauthorizedAccessException: Access to the path .(file path here). is denied.

I've checked the permissions of the file in question and the asp.net identity has full permissions and so should be able to delete the file?

Any reason this might be happening?

0
Comment
Question by:pat333
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 12361233
Is this file on the webserver?  the aspnet user has no permissions on other computers.

<identity impersonate="true" /> <-- make sure you DON'T have this in web.config
0
 

Author Comment

by:pat333
ID: 12361317
The file is on a secondary drive of the webserver. Identity impersonate is not on. The file(s) are actually put into into the location we are trying to delete from by the same webapplication.. so I don't really understand why there is an error when they come to be deleted later.
0
 
LVL 33

Accepted Solution

by:
raterus earned 500 total points
ID: 12361485
You wouldn't be using IIS 6.0 would you? (WinXP/Server 2003 runs it), IIS 6.0 doesn't use the aspnet user account, rather the "Network Service" Account.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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