RE: CreateDirectory() - Could not find a part of the path "D:\".

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Clinton,

Welcome to ASP.NET newsgroup.
>From your description, when you're using Directory.CreateDirectory to
create sub dirs through the path retrieved by the Server.MapPath("") , you
got
========
System.IO.DirectoryNotFoundException error: Could not find a part of the
path "D:\".
========

error. Also, you're suffering the problem on many other machines with the
same environement, yes?

Based on my loal test and the code sinppet, the problem is likely caused by
something with your environment. Would you help me confirm the following
things:

1. Does the problem occurs if you directly pass the full physical Path of
your application's virtual dir to the CreateDirectory function?

2. If still occurs, we may do some check on permission. How about turn off
impersonate and use the default process identity(should be machine\aspnet
for win2k server) and grant "modify/write" permission to that account. Test
again to see whether that can work. ( You can also test creating directory
through passing full qualified path when you swtich the process identity
and turn off impersonate).

BTW, to get the physical path of the root dir of our ASP.NET application,
we can use the
Server.MapPath("~/"), this will be better than using the empty string which
only retrieve the relative path the current directory.

Please feel free to let me know if you got any new findings or need any
further help. Thanks,


Steven Cheng
Microsoft Online Support

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








.



Relevant Pages

  • Re: Problem deploying forms authorization
    ... SERFVICE"(which as restricted permission), so it is likely that the ... protected resource under this account. ... Also, to make sure it is the process identity that cause the error, I ... ** change your ASP.NET applicaiton's IIS application pool identity from ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: asp.net and ldap
    ... you still use impersonate and grant the impersonated user the access ... permission to the folder you want to write? ... | permissions to the aspnet account, so it could upload images to a folder. ... |> I use this code to try to connect to ldap: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: machine.config - add assembly="*" - Required permissions cannot be acquired - IIS 6.0
    ... Regarding WSS - I have not yet worked with that and believe no website is ... > As you said that the when switching the process Identity to LOCAL SYSTEM, ... > it works(Do you mean that the applicaiton will run without any permission ... > the IWAM_SANDBOX or LocalService account are not the recommended process ...
    (microsoft.public.inetserver.iis)
  • RE: Unexpected windows login during long operations
    ... Steven Cheng ... the IIS/ASP.NET's worker process identity. ... access some certain resources that may require the permission from the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET performance counters not updating
    ... Switching the process identity to Local System is just to verify that the ... also have the sufficient permissions to update Perf counters. ... To adjust the security access permission, ...
    (microsoft.public.dotnet.framework.aspnet)