Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Directory.CreateDirectory() throwing DirectoryNotFound exception for //server/share path

Reply
Thread Tools

Directory.CreateDirectory() throwing DirectoryNotFound exception for //server/share path

 
 
Dan
Guest
Posts: n/a
 
      07-23-2004
Hello,

I am creating an ASP.NET web service with VB, and I need to be able to
create a directory on a network share. When I attempt to create the
directory (\\server\share\test), I receive the DirectoryNotFound
exception, stating "Could not find part of the path '\\server\share'."
I have also found that when I create the "test" folder in that
network share, and run Directory.Exists("\\server\share\test"), it
returns false.

All of the code works fine when dealing with local paths (such as
"C:\test"). I have verified that the account the web service is
running as has all the necessary permissions.

Any ideas?

Here is the actual code that throws the exception: (strFilePath =
"\\server\share\test")

If Not Directory.Exists(strFilePath) Then
Directory.CreateDirectory(strFilePath)
....

Thank you!
 
Reply With Quote
 
 
 
 
Max
Guest
Posts: n/a
 
      07-26-2004
What are the security permissions of \\server\share and of the underlying
directory on the server?
What permission does your code have?
Does it use Internet Guest Account (IUSR_<ComputerName>)?


"Dan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello,
>
> I am creating an ASP.NET web service with VB, and I need to be able to
> create a directory on a network share. When I attempt to create the
> directory (\\server\share\test), I receive the DirectoryNotFound
> exception, stating "Could not find part of the path '\\server\share'."
> I have also found that when I create the "test" folder in that
> network share, and run Directory.Exists("\\server\share\test"), it
> returns false.
>
> All of the code works fine when dealing with local paths (such as
> "C:\test"). I have verified that the account the web service is
> running as has all the necessary permissions.
>
> Any ideas?
>
> Here is the actual code that throws the exception: (strFilePath =
> "\\server\share\test")
>
> If Not Directory.Exists(strFilePath) Then
> Directory.CreateDirectory(strFilePath)
> ...
>
> Thank you!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert.aspx throwing exception =?Utf-8?B?RXVzdGljZSBTY3J1YmI=?= ASP .Net 0 09-23-2005 03:51 AM
System.IO.Directoryinfo throwing exception =?Utf-8?B?R2xlbm4gVmVuemtl?= ASP .Net 3 07-25-2005 09:49 PM
WebRequest.GetResponse() throwing exception (Internal Server error =?Utf-8?B?VGVycnk=?= ASP .Net 4 01-13-2005 10:25 PM
Problem of throwing an exception (System.Net.Sockets.OverlappedAsyncResult::CompletionPortCallback) VincentWong ASP .Net 1 12-29-2003 09:32 AM
Throwing Exception in a composite control KJ ASP .Net 5 07-25-2003 01:33 PM



Advertisments