circumventing CreateDirectory() errors

  • Thread starter Thread starter Tim Mulholland
  • Start date Start date
T

Tim Mulholland

What are my options for getting around the issues with
Directory.CreateDirectory() when i'm working on a hosted server where the
hosting company will not allow the ASPNET user to have read/list access to
the root of the drive (as is necessary for Directory.CreateDirectory() to
work, sadly)?

I have heard of a way to use unmanaged code to call _mkdir or something like
that instead, but that's very far from a clean solution.

What options are there?

Thanks in advance,

-Tim
 
Hi Tim,

As for the problem you mentioned, I think the better means is to contact
the web host to see whether they can help grant the proper access
permission of your app's folder to aspnet process account. Because
creating/modifying folder/file must have the NTFS file access permission,
we haven't any other means to do this task. Also, if it's impossible to
grant the permission to modify the app's root folder, you can also consider
creating a certain sub folder under the app's root folder and ask the
webhost to see whether can provide any particular setting for that sub dir.


Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top