Could not find a part of the path

G

gogaz

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.aspx?scid=kb;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.aspx?scid=kb;en-us;827421
 
C

Cowboy \(Gregory A. Beamer\)

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!
*************************************************
 
G

gogaz

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
 
G

gogaz

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top