471,089 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

Could not find a part of the path

Hi,

I know query in Subject line "Could not find a part of the path" has
been replied before lots of time, but mine is bit different.

My web server is windows 2003 R2 with both .net framework 1.1 and 2.0
installed on C:\.
Websites are saved on D:\wwwroot
I run the follow code for a website which is running on dedicated pool,
aspx files on 1.1 framework:

If Not directory.Exists(Server.mappath("..\Images\" & i)) then
directory.create(Server.mappath("..\Images\" & i))
end if

When i try to create a sub-folder 22 under D:\wwwroot\<website>\Images\
i get following error:

Could not find a part of the path "D:\"

If i manually create folder 22, then the code works fine to upload
images into that folder.

I googled a lot and tried everything... gave aspnet account full
permissions to D:, tried
http://support.microsoft.com/default...b;en-us;827421
also set up asp.net service to run using Network Service, restarted
server.. but all in vain

Then i changed the website properties -ASP.NET tab -ASP.NET version
from 1.1 to 2.0

And this did the trick and code started working fine.
But i have around 70 websites on this server using .net 1.1, and also I
DONT want to use this approach coz I am sure there must be a workaround
to use both 1.1 and 2.0 on same IIS and running websites properly

Please help!!

Thanx in advance

Warm Regards

PS: I got error in event log that permission denied to
\\<servername>\D$\System Volume Information
when i was running servermapdrive service mentioned in
http://support.microsoft.com/default...b;en-us;827421

Aug 31 '06 #1
3 11201
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
<go***@rediffmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi,

I know query in Subject line "Could not find a part of the path" has
been replied before lots of time, but mine is bit different.

My web server is windows 2003 R2 with both .net framework 1.1 and 2.0
installed on C:\.
Websites are saved on D:\wwwroot
I run the follow code for a website which is running on dedicated pool,
aspx files on 1.1 framework:

If Not directory.Exists(Server.mappath("..\Images\" & i)) then
directory.create(Server.mappath("..\Images\" & i))
end if

When i try to create a sub-folder 22 under D:\wwwroot\<website>\Images\
i get following error:

Could not find a part of the path "D:\"

If i manually create folder 22, then the code works fine to upload
images into that folder.

I googled a lot and tried everything... gave aspnet account full
permissions to D:, tried
http://support.microsoft.com/default...b;en-us;827421
also set up asp.net service to run using Network Service, restarted
server.. but all in vain

Then i changed the website properties -ASP.NET tab -ASP.NET version
from 1.1 to 2.0

And this did the trick and code started working fine.
But i have around 70 websites on this server using .net 1.1, and also I
DONT want to use this approach coz I am sure there must be a workaround
to use both 1.1 and 2.0 on same IIS and running websites properly

Please help!!

Thanx in advance

Warm Regards

PS: I got error in event log that permission denied to
\\<servername>\D$\System Volume Information
when i was running servermapdrive service mentioned in
http://support.microsoft.com/default...b;en-us;827421

Aug 31 '06 #2
Cheers for the reply.

But how come it works with ASP 2.0 on the same IIS?

And can you please tell me how to
1) "You can turn of this security feature in IIS, if you wish to"
2) "I believe there is also a code access security setting in the
machine.config that restricts you"

Thanks

Cowboy (Gregory A. Beamer) wrote:
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Aug 31 '06 #3
Ok, i got the solution.

First of all i have Ensim on this server which creates application
pools that run with user credentials (and users are member of
WVH_ANON_USERS_GROUP)

And when i looked on permission settings on D:, this group had special
permission that denies any sort of access on D:

I gave Read Permissions for D: "This folder only" to
WVH_ANON_USERS_GROUP and it started working.

So bottom line is, that when u get such problem, you should first check
which Application Pool you have defined for the website in IIS. Then in
IIS, right click on that application pool -properties -Identity
If the second radio button is selected, check the username specified
and make sure that user has got read permissions to D: or the root
drive you want to access

HTH
go***@rediffmail.com wrote:
Cheers for the reply.

But how come it works with ASP 2.0 on the same IIS?

And can you please tell me how to
1) "You can turn of this security feature in IIS, if you wish to"
2) "I believe there is also a code access security setting in the
machine.config that restricts you"

Thanks

Cowboy (Gregory A. Beamer) wrote:
2003, by design, does not allow path traversal, which means your ASP.NET
code is stuck in its tree. You are attempting to traverse back to root of
the drive and create a folder. You can turn of this security feature in IIS,
if you wish to. I believe there is also a code access security setting in
the machine.config that restricts you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Aug 31 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by jessica | last post: by
1 post views Thread by Steve | last post: by
9 posts views Thread by Clinton Frankland | last post: by
14 posts views Thread by Gianfranco | last post: by

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.