473,786 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with System.IO.Direc tory.CreateDire ctory in ASP.NET application.

I am trying to dynamically create directories in my ASP.NET application (I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a part
of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does not
allow my read access above my wwwroot folder which seems to be a problem
when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/
Jul 21 '05 #1
7 5272
Eran,

ASP.NET usually runs under account that doesn't have file writing rights at
all. Speak to your ISP.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application (I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a part of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does not allow my read access above my wwwroot folder which seems to be a problem
when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/

Jul 21 '05 #2
the ASPNET user...
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:OB******** *****@TK2MSFTNG P15.phx.gbl...
Eran,

ASP.NET usually runs under account that doesn't have file writing rights at all. Speak to your ISP.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a

part
of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does

not
allow my read access above my wwwroot folder which seems to be a problem
when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/


Jul 21 '05 #3
The ASP.NET worker process user has file writing capabilities under my
specific folder (it can create\modify files in existing directories).
The problem is when trying to create a new directory....

"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:OB******** *****@TK2MSFTNG P15.phx.gbl...
Eran,

ASP.NET usually runs under account that doesn't have file writing rights
at
all. Speak to your ISP.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application
(I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a

part
of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does

not
allow my read access above my wwwroot folder which seems to be a problem
when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/


Jul 21 '05 #4
So why do I get a wierd "Could not find a part of the path "D:\" exception
instead of a security exception (unauthorized access or something) ?
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:OB******** *****@TK2MSFTNG P15.phx.gbl...
Eran,

ASP.NET usually runs under account that doesn't have file writing rights
at
all. Speak to your ISP.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application
(I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a

part
of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does

not
allow my read access above my wwwroot folder which seems to be a problem
when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/


Jul 21 '05 #5
Have you tried just writing out the string you are generating
from Server.MapPath( "/") + "test" ?
What have you got there?

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application (I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a
part of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does
not allow my read access above my wwwroot folder which seems to be a
problem when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/

Jul 21 '05 #6
Yes, you get all sort of wierd exceptions when you run into security
problems. You are right about writting into existing folders, but I am not
sure if creating directories is the same permission as writting files.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:Oo******** ******@TK2MSFTN GP10.phx.gbl...
So why do I get a wierd "Could not find a part of the path "D:\" exception
instead of a security exception (unauthorized access or something) ?
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:OB******** *****@TK2MSFTNG P15.phx.gbl...
Eran,

ASP.NET usually runs under account that doesn't have file writing rights
at
all. Speak to your ISP.

Eliyahu

"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application
(I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a

part
of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does
not
allow my read access above my wwwroot folder which seems to be a

problem when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/



Jul 21 '05 #7
Yes I tried that.
Same error

I even tried using DirectoryInfo to get to the wwwroot dir and then creating
a subdirectory and got the same exception...

"Dennis Myrén" <de****@oslokb. no> wrote in message
news:IH******** **********@news 4.e.nsc.no...
Have you tried just writing out the string you are generating
from Server.MapPath( "/") + "test" ?
What have you got there?

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Eran Kampf" <er**@ekampf.co m> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
I am trying to dynamically create directories in my ASP.NET application (I
am using Server.MapPath( "/")+"test" as the folder)
and I am getting a DirectoryNotFou ndException saying "Could not find a
part of the path "D:\".
My site is hosted on a public ISP that for obvious security reasons does
not allow my read access above my wwwroot folder which seems to be a
problem when trying to create directories...

Is there any way to solve this?

--
Eran Kampf
blog: http://www.ekampf.com/blog
Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/


Jul 21 '05 #8

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

Similar topics

5
1113
by: matt dittman | last post by:
I have created a windows service that reads emails from a drop directory and moves them to the appropriate mail folder every 15 seconds. I can move, rename and delete the files as needed, up until the CDO.DropDirectory.GetMessages() method is called. At this point, the files are locked until I shut down the service. After processing and delivery, I need to be able to delete all the files in the drop directory. I can delete them via...
6
9267
by: Chad | last post by:
I am receiving the following two errors in the code below. Both are on Line 56. error C2039: 'CreateDirectoryA' : is not a member of 'System::IO::Directory' error C2660: 'CreateDirectoryA' : function does not take 1 arguments Could anyone please point me in thr right direction?
4
2972
by: Daniel | last post by:
If i log into my computer as domain A and user X and password Y but then I need to give C# application access to domain B as user F and password G. Is this possible? or do i have to log into the computer as domain B, user F and password G in order for the application to have permissions to domain B? I would like to stay logged in as domain A but just give my C# application access to domain B. In my application I need file system access that...
4
1685
by: Snake | last post by:
Hello, I'm developping an application which has to create a directory on a remote server. I'm using the createdirectory API fonction which works well when the PC runs win2000. Now, when I use WinXP, my application freeze at the first run, and works fine at the second run. I would like to know if some constant has to be initialized, or if something else needs to be done.
5
1612
by: Arsalan Ahmad | last post by:
Hi all, I am developing a simple one page application in ASP.NET which takes an input in a text box and print in a label. But when i uploaded it to the website i get the following error: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
3
2296
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 "D:\". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path) at System.IO.Directory.CreateDirectory(String path) at TestVBProject.createdirectorytest.Page_Load(Object...
5
5146
by: Philip Wagenaar | last post by:
I have a Windows Form application that monitors a directory using the System.IO.FileSystemWatcher. On the event created I run a sub that sends an xml file over http to a service. When I copy 7000 files in the directory to be monitored only 123 are sent to the service. What might be going wrong?
4
1468
by: Stimp | last post by:
When a user registers with my site, I create a separate folder for them (for uploading photos, etc). The code for this has been working fine for 1 year, but over the past 2 weeks it has been falling down on the 'CreateDirectory' function. The error I'm getting is: "Could not find a part of the path "E:\"."
1
4116
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET framework 1.1). The application implements a Progress Bar webcontrol, that pops up in a window, using the HttpHandler interface, on the event of a button click. The handler's process request routine reads the status of the progress by querying the...
4
2573
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 ExtractToTempLocation(string aZip) { try
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
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 we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.