?
Solved

Unauthorized access exception

Posted on 2004-10-20
5
Medium Priority
?
1,162 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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