Permissions issue - can't programmatically delete files on the server



Howdy.
I've got a permissions issue I can't figure out; I've been searching
for info and haven't found anything to help me.

I'm testing an ASP.Net 2.0 application that allows a user to upload
files, and delete them later. The upload works fine; the file gets
saved to the proper directory. The delete does not. Here's the info:

* * *

Access to the path 'F:\My App\Path\SubDir\materials\' is denied.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the
path 'F:\Terra Cognita\Operations\Projects\IRC
E-zine\ProjectFiles\NewWebPublisher\webInterface\ads\materials\' is
denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS
5 or Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user
(typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.

* * *

It's the call to System.IO.File.Delete that causes the exception.

Seems straightforward enough. Except that when I check the folder's
permissions in Windows Explorer (I'm testing on my local machine),
"ASP.NET Machine Account" and "Internet Guest Account" both have full
control on that specific directory. (I started off by giving them
"Delete Subfolders and Files" permissions on that directory, but when
that didn't work...)

Can *anyone* help me figure this out? It's driving me to drink.

Windows 2000, IIS 5.0, Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42.

Regards,
Remi.

.



Relevant Pages

  • Re: owa error - problem occured while trying to use your mailbox.
    ... This exception may occur if the Allow inheritable permissions check box is not selected on the user object or on the OU container in Active Directory Users and Computers. ... Microsoft.Exchange.Data.Directory.ADSession.AnalyzeDirectoryError(PooledLdapConnection connection, DirectoryRequest request, DirectoryException de, Int32 totalRetries, Int32 retriesOnServer) ...
    (microsoft.public.exchange.clients)
  • Re: RWW
    ... Were the permissions correct, or did you have to adjust them? ... >> Add Local Service and Network Service account Read & Execute, ... >>> current web request. ... >>> Exception Details: System.UnauthorizedAccessException: Access to the ...
    (microsoft.public.windows.server.sbs)
  • Re: Receiving a strong name error when trying to access a library
    ... or use one of the other strong name hacking techniques ... > you are using asp.net) the request will have the security context of the ... > ASPNET account does not have enough permissions, ... >> an assembly tag with in code? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: System.Security.SecurityException
    ... I needed to add permissions ... > I'm attempting to build an app then sends a request to a URL and reads the ... > Public Function LoadURL(ByVal Url As String) As String ... > Dim sr As New StreamReader ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Access is denied
    ... What are you trying to instantiate? ... then check permissions on that object. ... What do you mean by all permissions (for ASP account)? ... > execution of the current web request. ...
    (microsoft.public.dotnet.framework.aspnet.security)