473,498 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Directory.CreateDirectory Method throws UnauthorizedAccessException

GM
Any help is greatly appreciated! I'm up against a meeting deadline.

Directory.CreateDirectory Method throws UnauthorizedAccessException

Here is the path:

"C:\JumpStart\JumpStart\sites\Proto\images\sit es.e-Plaza.org\Alece"

Everything before 'Alece' already exists.

I've tried the following:

For parent directory:
C:\JumpStart\JumpStart\sites\Proto\images\sites.e-Plaza.org

Set security permissions for ASP.NET to 'Modify' (and even full control)
Set security permissions for ISUR-server to 'Modify' (and even full control)

Set UNC share permissions of 'JumpStart' (parent) to 'Write'

Set IIS permissions for 'images' directory and subs to 'Write'

Still I get 'UnauthorizedAccessException'

THANKS!
Gary
Nov 18 '05 #1
2 4104
Yes, This error makes sense. ASP.NET application runs under ASPNET account by default. IIS setting might allow users to write, but Windows security doesn't allow ASPNET user to do so.
2 possible solutions

1. Give ASPNET user more control; add him to User or Poweruser group. This might not be the best solution if security is your concern
2. Enable Win authentication on this site. Then enable impersonation in web.config file. This solution will work if it's an Intranet type application
Nov 18 '05 #2
GM
Whoops! I had quotation marks around the variable defining the path.
No amount of permissions were going to allow creating a "ImgDir" path.

"GM" <gm*********@starband.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Any help is greatly appreciated! I'm up against a meeting deadline.

Directory.CreateDirectory Method throws UnauthorizedAccessException

Here is the path:

"C:\JumpStart\JumpStart\sites\Proto\images\sit es.e-Plaza.org\Alece"

Everything before 'Alece' already exists.

I've tried the following:

For parent directory:
C:\JumpStart\JumpStart\sites\Proto\images\sites.e-Plaza.org

Set security permissions for ASP.NET to 'Modify' (and even full control)
Set security permissions for ISUR-server to 'Modify' (and even full control)
Set UNC share permissions of 'JumpStart' (parent) to 'Write'

Set IIS permissions for 'images' directory and subs to 'Write'

Still I get 'UnauthorizedAccessException'

THANKS!
Gary

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1251
by: David Krmpotic | last post by:
Hi! When I try to create the directory somewhere on the network (eg. \\comp1\c\here), I get "cannot find part of the path..." exception on .NET 1.1. on 2.0 I get UnauthorizedAccessException I...
1
2410
by: Daniel | last post by:
If I call CreateDirectory(\\\\devDriveA\\foo\\bar\\a\\b\\c) and \\devDriveA\foo\bar already exists then sub directories a\b\c don't get created. When I use CreateDirectory on my own file system,...
1
1512
by: H.B. | last post by:
Hi, Is there a way to avoid conflicts between CreateDirectory() (from API) and Directory::CreateDirectory(). The other functions from Directory class works(Exists() as example). It seems to be...
3
2276
by: James Coleman | last post by:
Hello, The following error is appearing when attempting to create a directory using the availale system.io methods: System.IO.DirectoryNotFoundException: Could not find a part of the path...
3
2979
by: James | last post by:
..2003 have a filesystemwatcher ... does it have a directorysystemwatcher ? What i need is to watch whether directory is deleted ? i assume filesystemwatcher delete method is for file, not...
23
2393
by: **Developer** | last post by:
Is there an easy way to copies all files in a directory into another directory? What about coping subdirectories too? Thanks in advance for any info
12
2517
by: samoore33 | last post by:
I found a real nice article on how to copy a directory on MSDN. The only problem is that I can not figure out how to get the namespace Microsoft.VisualBasic.MyServices. I wanted to know if anyone...
2
2497
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I am having a bit of a nightmare with the following: if(!Directory.Exists(folderPath)) Directory.CreateDirectory(folderPath); When I add a watch to this while debugging I see that the...
4
2549
by: Tom | last post by:
This is really weird, but I have the following code: private static readonly string mString = "tempUnzipDir" + Path.DirectorySeparatorChar; .... public static string...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.