473,688 Members | 3,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.IO.Direc toryNotFoundExc eption: Could not find a part of the path

I'm trying to create a directory on the web server with a
vb.net code:
....

Dim dirName As String = "w:\filepath\im ages"

If Not Directory.Exist s(dirName) Then
Directory.Creat eDirectory(dirN ame)
Label1.Text = "Directory created"
Else
Label1.Text = "Directory exists"
End If

....

And I'm getting an exception:
Could not find a part of the path "w:\".

Exception Details: System.IO.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".

When I run it with "w:\filepat h\" it says "Directory
exists". Only when I want to create a new directory the
exception occurs. The ASP.NET user has all rights on that
drive, and there would be another exception
like ... "access to path denied".

Does anyone knows what is going on here and what does it
mean "could not find a part of the path"?

I can run this code locally and it works fine, the problem
is only at my webservers host computer.

Regards
Matthias

ps here the full exception:
Could not find a part of the path "w:\".
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.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".

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:
[DirectoryNotFou ndException: Could not find a part of the
path "w:\".]
System.IO.__Err or.WinIOError(I nt32 errorCode, String
str) +287
System.IO.Direc tory.InternalCr eateDirectory(S tring
fullPath, String path) +489
System.IO.Direc tory.CreateDire ctory(String path) +195
config.test.But ton1_Click(Obje ct sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
+108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEve
ntHandler.Raise PostBackEvent(S tring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent
(IPostBackEvent Handler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent
(NameValueColle ction postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277


-----------------------------------------------------------
---------------------
Version Information: Microsoft .NET Framework
Version:1.1.432 2.573; ASP.NET Version:1.1.432 2.573


Jul 21 '05 #1
1 53465
Problem solved: In the security for the w: directory, the
ASP.NET user needs Read permission.

-----Original Message-----
I'm trying to create a directory on the web server with avb.net code:
....

Dim dirName As String = "w:\filepath\im ages"

If Not Directory.Exist s(dirName) Then
Directory.Creat eDirectory(dirN ame)
Label1.Text = "Directory created"
Else
Label1.Text = "Directory exists"
End If

....

And I'm getting an exception:
Could not find a part of the path "w:\".

Exception Details: System.IO.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".

When I run it with "w:\filepat h\" it says "Directory
exists". Only when I want to create a new directory the
exception occurs. The ASP.NET user has all rights on that
drive, and there would be another exception
like ... "access to path denied".

Does anyone knows what is going on here and what does it
mean "could not find a part of the path"?

I can run this code locally and it works fine, the problemis only at my webservers host computer.

Regards
Matthias

ps here the full exception:
Could not find a part of the path "w:\".
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 whereit originated in the code.

Exception Details: System.IO.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".

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:
[DirectoryNotFou ndException: Could not find a part of the
path "w:\".]
System.IO.__Err or.WinIOError(I nt32 errorCode, String
str) +287
System.IO.Direc tory.InternalCr eateDirectory(S tring
fullPath, String path) +489
System.IO.Direc tory.CreateDire ctory(String path) +195
config.test.But ton1_Click(Obje ct sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
+108

System.Web.UI. WebControls.But ton.System.Web. UI.IPostBackEv entHandler.Rais ePostBackEvent( String eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent
(IPostBackEven tHandler sourceControl, String
eventArgumen t) +18
System.Web.UI.P age.RaisePostBa ckEvent
(NameValueColl ection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277


---------------------------------------------------------- ----------------------
Version Information: Microsoft .NET Framework
Version:1.1.43 22.573; ASP.NET Version:1.1.432 2.573


.

Jul 21 '05 #2

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

Similar topics

0
1541
by: Tom Vogel | last post by:
Creating a subfolder within my ASP.NET application folder fails with the above error, but only at my hosting provider. The command: Directory.CreateDirectory(path) Path is set to 'D:\appfolder\test2'. ASPNET has full control on the application folder. Any ideas why this fails? - Tom
4
4600
by: Frederico Caldeira Knabben | last post by:
Hello, I'm having a problem when trying to use the Directory.CreateDirectory() method. It throws a DirectoryNotFoundException exception. I'll try to illustrate it: Suppose you have the following (existing) directory: d:\Sites\MySite\ And you whant to create the following:
7
5266
by: Eran Kampf | last post by:
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 DirectoryNotFoundException 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?
1
4501
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and contains information for the visualization and storage of the retrieved data. From mid july till now, i have made 4 different configuration sets and everything was fine. Today, i got the order to make a new configuration set. When the xml file was...
5
2877
by: Andy Lim | last post by:
Hello all, I just moved one of my ASP.NET application to a new hosting. But the same application that used to work perfectly before now returns this error: System.IO.DirectoryNotFoundException What's wrong here? and how to resolve it?
4
2215
by: Jacques Wentworth | last post by:
I'm trying to access a Folder on a different Server using ASP.NET, and are getting a DirectoryNotFoundException. It works fine when I access the local drives on the server. I made sure the folder does exist. I've put my code below to show what I'm trying to do. Thanks Jacques Wentworth
2
5655
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then Directory.CreateDirectory(dirName) Label1.Text = "Directory created" Else
1
5386
by: Berryl Hesh | last post by:
I don't know where the "%" sysmbols are coming from, but without them this is a valid directory. I've pasted both the exception and code that triggeered it below. The purpose of this code block is to gather a list of dll's. Thanks - BH Here is the Code /-------------------------------/
0
8590
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
8528
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
9072
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
8947
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...
1
8782
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7621
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
4321
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...
3
1950
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.