Directory issue
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-io' list.


Ryan Trudelle-Schwarz
Any ideas what is wrong here? I was expecting a Security Exception =
because I haven't set up the perms on this directory but instead it is =
throwing the below exception.

If I create a directory info pointing at the root it states it exists =
(obviously). So why the exception?

Thanks, Ryan

------------------------------------------------------------------------

Code:

Dim dirInfo As System.IO.DirectoryInfo
dirInfo =3D System.IO.Directory.CreateDirectory(Server.MapPath("/" & =
"jun02"))
------------------------------------------------------------------------

Error:=20

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

Description: An unhandled exception occurred during the execution of the =
current web request. Please review the stack trace for more information =
about the error and where it originated in the code.=20

Exception Details: System.IO.DirectoryNotFoundException: Could not find =
a part of the path "D:\".

Source Error:=20

An unhandled exception was generated during the execution of the current =
web request. Information regarding the origin and location of the =
exception can be identified using the exception stack trace below. =20

Stack Trace:=20

[DirectoryNotFoundException: Could not find a part of the path "D:\".]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +287
System.IO.Directory.InternalCreateDirectory(String fullPath, String =
path) +482
System.IO.Directory.CreateDirectory(String path) +195

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Brad Kingsley
Does the ASPNet account have access up the entire tree? (D:, D:\folder1\,
D:\folder1\subfolder\, etc...)

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

----- Original Message -----
From: "Ryan Trudelle-Schwarz" <Click here to reveal e-mail address>
To: "ngfx-io" <Click here to reveal e-mail address>
Sent: Friday, May 24, 2002 5:09 AM
Subject: [ngfx-io] Directory issue

Any ideas what is wrong here? I was expecting a Security Exception because I
haven't set up the perms on this directory but instead it is throwing the
below exception.

If I create a directory info pointing at the root it states it exists
(obviously). So why the exception?

Thanks, Ryan

------------------------------------------------------------------------

Code:

Dim dirInfo As System.IO.DirectoryInfo
dirInfo = System.IO.Directory.CreateDirectory(Server.MapPath("/" & "jun02"))
------------------------------------------------------------------------

Error:

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

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path "D:\".

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path "D:\".]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +287
System.IO.Directory.InternalCreateDirectory(String fullPath, String path)
+482
System.IO.Directory.CreateDirectory(String path) +195

---
[This E-mail scanned for viruses by Declude Virus]

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

---
[This E-mail scanned for viruses by Declude Virus]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>RE: [ngfx-io] Directory issue</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi Ryan</FONT>
</P>

<P><FONT SIZE=3D2>Firstly is it a local(on your machine that the app is =
running?) directory.</FONT>
</P>

<P><FONT SIZE=3D2>If YES then</FONT>
<BR><FONT SIZE=3D2>Right click --->properties--->security add =
MACHINENAME\ASPNET account to that folder with the relevant perm =
</FONT>
</P>

<P><FONT SIZE=3D2>ELSE</FONT>
</P>

<P><FONT SIZE=3D2>What you need to do is check how to impersonate a =
different user that has permissions on that folder or the user that is =
logged to the machine. Go to the Microsoft site here is the Q number: =
Q306158 that will tell you how to impersonate a user for specific =
code.</FONT></P>

<P><FONT SIZE=3D2>The error you getting is what I had I was sure the =
dir was there but it would keep saying no path which is actually a =
security fault meaning you don't have the rights to view the =
path.</FONT></P>

<P><FONT SIZE=3D2>You see when your app runs it is running all its =
processes as MACHINENAME\ASPNET account which is a local account and =
does not have any network permissions and does not by default have any =
permissions on most new folders.</FONT></P>

<P><FONT SIZE=3D2>Give your account (network log in) permissions on =
that folder and then use the impersonation code to specify that users =
add the code you are trying to run between that and you should be =
fine.</FONT></P>
<BR>

<P><FONT SIZE=3D2>Let us know.</FONT>
</P>

<P><FONT SIZE=3D2>CM</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Ryan Trudelle-Schwarz [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Friday, May 24, 2002 11:10 AM</FONT>
<BR><FONT SIZE=3D2>To: ngfx-io</FONT>
<BR><FONT SIZE=3D2>Subject: [ngfx-io] Directory issue</FONT>
</P>

<P><FONT SIZE=3D2>Any ideas what is wrong here? I was expecting a =
Security Exception because I haven't set up the perms on this directory =
but instead it is throwing the below exception.</FONT></P>

<P><FONT SIZE=3D2>If I create a directory info pointing at the root it =
states it exists (obviously). So why the exception?</FONT>
</P>

<P><FONT SIZE=3D2>Thanks, Ryan</FONT>
</P>

<P><FONT =
SIZE=3D2>---------------------------------------------------------------=
---------</FONT>
</P>

<P><FONT SIZE=3D2>Code:</FONT>
</P>

<P><FONT SIZE=3D2>Dim dirInfo As System.IO.DirectoryInfo</FONT>
<BR><FONT SIZE=3D2>dirInfo =3D =
System.IO.Directory.CreateDirectory(Server.MapPath("/" & =
"jun02"))</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
---------</FONT>
</P>

<P><FONT SIZE=3D2>Error: </FONT>
</P>

<P><FONT SIZE=3D2>Could not find a part of the path "D:\". =
</FONT>
</P>

<P><FONT SIZE=3D2>Description: An unhandled exception occurred during =
the execution of the current web request. Please review the stack trace =
for more information about the error and where it originated in the =
code. </FONT></P>

<P><FONT SIZE=3D2>Exception Details: =
System.IO.DirectoryNotFoundException: Could not find a part of the path =
"D:\".</FONT>
</P>

<P><FONT SIZE=3D2>Source Error: </FONT>
</P>

<P><FONT SIZE=3D2>An unhandled exception was generated during the =
execution of the current web request. Information regarding the origin =
and location of the exception can be identified using the exception =
stack trace below.  </FONT></P>

<P><FONT SIZE=3D2>Stack Trace: </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>[DirectoryNotFoundException: Could not find a part of =
the path "D:\".]</FONT>
<BR><FONT SIZE=3D2>   System.IO.__Error.WinIOError(Int32 =
errorCode, String str) +287</FONT>
<BR><FONT SIZE=3D2>   =
System.IO.Directory.InternalCreateDirectory(String fullPath, String =
path) +482</FONT>
<BR><FONT SIZE=3D2>   =
System.IO.Directory.CreateDirectory(String path) +195</FONT>
</P>

<P><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>[This E-mail scanned for viruses by Declude =
Virus]</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>| [ngfx-io] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.aspfriends.com/aspfriends/ngfx-io.asp"" target="_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp"; =
TARGET=3D"_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp</A> =
=3D JOIN/QUIT</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Ryan Trudelle-Schwarz
Does it matter? It should be throwing a security exception for any =
permissions issues, not a DirectoryNotFound exception.

-> -----Original Message-----
-> From: Brad Kingsley [mailto:Click here to reveal e-mail address]
->=20
-> Does the ASPNet account have access up the entire tree? (D:, =
D:\folder1\,
-> D:\folder1\subfolder\, etc...)
->=20
-> ~Brad Kingsley
->=20
-> ----- Original Message -----
-> From: "Ryan Trudelle-Schwarz" <Click here to reveal e-mail address>
->=20
-> Any ideas what is wrong here? I was expecting a Security Exception
-> because I
-> haven't set up the perms on this directory but instead it is throwing =
the
-> below exception.
->=20
-> If I create a directory info pointing at the root it states it exists
-> (obviously). So why the exception?
->=20
-> Thanks, Ryan
->=20
-> =
------------------------------------------------------------------------
->=20
-> Code:
->=20
-> Dim dirInfo As System.IO.DirectoryInfo
-> dirInfo =3D System.IO.Directory.CreateDirectory(Server.MapPath("/" &
-> "jun02"))
-> =
------------------------------------------------------------------------
->=20
-> Error:
->=20
-> Could not find a part of the path "D:\".
->=20
-> Description: An unhandled exception occurred during the execution of =
the
-> current web request. Please review the stack trace for more =
information
-> about the error and where it originated in the code.
->=20
-> Exception Details: System.IO.DirectoryNotFoundException: Could not =
find a
-> part of the path "D:\".
->=20
-> Source Error:
->=20
-> An unhandled exception was generated during the execution of the =
current
-> web
-> request. Information regarding the origin and location of the =
exception
-> can
-> be identified using the exception stack trace below.
->=20
-> Stack Trace:
->=20
->=20
-> [DirectoryNotFoundException: Could not find a part of the path =
"D:\".]
-> System.IO.__Error.WinIOError(Int32 errorCode, String str) +287
-> System.IO.Directory.InternalCreateDirectory(String fullPath, =
String
-> path)
-> +482
-> System.IO.Directory.CreateDirectory(String path) +195

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Brad Kingsley
Yes it does matter, and yes it could throw that error message.

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

----- Original Message -----
From: "Ryan Trudelle-Schwarz" <Click here to reveal e-mail address>
To: "ngfx-io" <Click here to reveal e-mail address>
Sent: Friday, May 24, 2002 10:32 AM
Subject: [ngfx-io] Re: Directory issue

Does it matter? It should be throwing a security exception for any
permissions issues, not a DirectoryNotFound exception.

-> -----Original Message-----
-> From: Brad Kingsley [mailto:Click here to reveal e-mail address]
->
-> Does the ASPNet account have access up the entire tree? (D:, D:\folder1\,
-> D:\folder1\subfolder\, etc...)
->
-> ~Brad Kingsley
->
-> ----- Original Message -----
-> From: "Ryan Trudelle-Schwarz" <Click here to reveal e-mail address>
->
-> Any ideas what is wrong here? I was expecting a Security Exception
-> because I
-> haven't set up the perms on this directory but instead it is throwing the
-> below exception.
->
-> If I create a directory info pointing at the root it states it exists
-> (obviously). So why the exception?
->
-> Thanks, Ryan
->
-> ------------------------------------------------------------------------
->
-> Code:
->
-> Dim dirInfo As System.IO.DirectoryInfo
-> dirInfo = System.IO.Directory.CreateDirectory(Server.MapPath("/" &
-> "jun02"))
-> ------------------------------------------------------------------------
->
-> Error:
->
-> Could not find a part of the path "D:\".
->
-> Description: An unhandled exception occurred during the execution of the
-> current web request. Please review the stack trace for more information
-> about the error and where it originated in the code.
->
-> Exception Details: System.IO.DirectoryNotFoundException: Could not find a
-> part of the path "D:\".
->
-> Source Error:
->
-> An unhandled exception was generated during the execution of the current
-> web
-> request. Information regarding the origin and location of the exception
-> can
-> be identified using the exception stack trace below.
->
-> Stack Trace:
->
->
-> [DirectoryNotFoundException: Could not find a part of the path "D:\".]
-> System.IO.__Error.WinIOError(Int32 errorCode, String str) +287
-> System.IO.Directory.InternalCreateDirectory(String fullPath, String
-> path)
-> +482
-> System.IO.Directory.CreateDirectory(String path) +195

---
[This E-mail scanned for viruses by Declude Virus]

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

---
[This E-mail scanned for viruses by Declude Virus]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
 
System.IO.Directory
System.IO.DirectoryInfo
System.IO.DirectoryNotFoundException




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com