Solved

Unauthorized access exception

Posted on 2004-10-20
5
1,144 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
  • 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 125 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reset asp.net login password 4 42
jquery progress bar 3 40
Problem to refer to value 8 45
Question about JQuery and asp.net 3 23
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

18 Experts available now in Live!

Get 1:1 Help Now