[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

can't create directory from web service

Marc Pensa

9/3/2003 9:50:00 PM

Using the Directory object I issue a createdirectory
command and get an exception:
System.IO.DirectoryNotFoundException: Could not find a
part of the path "V:\".

I get this error whether I use UNC or drive mapping. I
started getting this error once I deployed the webservice
to my server. It works fine when running locally.

Any help??

Thanks in advance,
Marc
3 Answers

v-lwang

9/4/2003 6:17:00 AM

0

Hi Marc,

By default, the Aspnet_wp.exe process runs under a computer account named
ASPNET. However, this account does not have the required privileges to
create directory on a remote server. So you may do impersonation before
creating the directory. Here is an article about how to impersonate in
ASP.NET. Please check it for your reference.

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/...


Please let me know if you need more information. Thanks

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "Marc Pensa" <marc.pensa@zurichna.com>
| Sender: "Marc Pensa" <marc.pensa@zurichna.com>
| Subject: can't create directory from web service
| Date: Wed, 3 Sep 2003 14:49:56 -0700
| Lines: 13
| Message-ID: <131001c37265$5093e940$a601280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNyZVCTWvOibhamRvW2+HOygFvo0g==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19168
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Using the Directory object I issue a createdirectory
| command and get an exception:
| System.IO.DirectoryNotFoundException: Could not find a
| part of the path "V:\".
|
| I get this error whether I use UNC or drive mapping. I
| started getting this error once I deployed the webservice
| to my server. It works fine when running locally.
|
| Any help??
|
| Thanks in advance,
| Marc
|

v-lwang

9/5/2003 11:18:00 AM

0

Hi Marc,

Based on the description, it's difficult to find where the problem is. To
work out this issue, I need to know more information.

1. Can you create directory using the UNC path from the server?
2. Would you please tell me how you set the privilege for the web service?
3. How do you configure the IIS, web.config and machine.config?
Thanks.

Lewis
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: Marc Pensa <marc.pensa@zurichna.com>
| References: <131001c37265$5093e940$a601280a@phx.gbl>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: Re: can't create directory from web service
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <uLyNF7wcDHA.2416@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Date: Thu, 04 Sep 2003 11:02:55 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19193
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Thanks for responding. We set our web services to run under a domain
| user id with domain admin authority. Thus I wouldn't think I would need
| to impersonate another account would I??
|
| Could there be something else interferring? When the error message
| prints it shows either the drive which a mapped to a share such as
| \\serername\share and doesn't mention the rest of the path or if I use
| the drive letter that is mapped to the above it shows just the drive
| letter in the error message.
|
| It seems I can't get to this share.
|
| Would using directoryinfo or the one of the file objects work
| differently?
|
| Thanks,
| Marc
|
|
|
| *** Sent via Developersdex http://www.develop... ***
| Don't just participate in USENET...get rewarded for it!
|

Marc Pensa

9/9/2003 2:39:00 PM

0

1. No I cannot get the code to work using either UNC and
the share nor a drive letter mapped to the share.

2. I set security by changing the machine config file in
the framework directory to use a standard service user id
which has domain auth.

3. I am not sure what you want here. After creating the
virtual directory for the web service, I set the anonymous
user id to the same service account mentioned above. I do
not modify the web config file unless I may change it to
display detailerd asp error messages on remote machines.
After fixing the problem I always reset this.

With additional testing I have found a work around. If I
access the target folder using UNC and the actual drive
share for admin access "E$" it works fine. The share I
am referrencing exists on this drive. Why would the admin
share (drive letter plus $) work when the other share
doesn't?

Thanks,
Marc
>-----Original Message-----
>Hi Marc,
>
>Based on the description, it's difficult to find where
the problem is. To
>work out this issue, I need to know more information.
>
>1. Can you create directory using the UNC path from
the server?
>2. Would you please tell me how you set the privilege
for the web service?
>3. How do you configure the IIS, web.config and
machine.config?
>Thanks.
>
>Lewis
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>--------------------
>| From: Marc Pensa <marc.pensa@zurichna.com>
>| References: <131001c37265$5093e940$a601280a@phx.gbl>
>| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
>| Subject: Re: can't create directory from web service
>| Mime-Version: 1.0
>| Content-Type: text/plain; charset="us-ascii"
>| Content-Transfer-Encoding: 7bit
>| Message-ID: <uLyNF7wcDHA.2416@TK2MSFTNGP10.phx.gbl>
>| Newsgroups:
microsoft.public.dotnet.framework.aspnet.webservices
>| Date: Thu, 04 Sep 2003 11:02:55 -0700
>| NNTP-Posting-Host: actionjackson133.dsl.frii.net
216.17.147.133
>| Lines: 1
>| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!
TK2MSFTNGP10.phx.gbl
>| Xref: cpmsftngxa06.phx.gbl
>microsoft.public.dotnet.framework.aspnet.webservices:19193
>| X-Tomcat-NG:
microsoft.public.dotnet.framework.aspnet.webservices
>|
>| Thanks for responding. We set our web services to run
under a domain
>| user id with domain admin authority. Thus I wouldn't
think I would need
>| to impersonate another account would I??
>|
>| Could there be something else interferring? When the
error message
>| prints it shows either the drive which a mapped to a
share such as
>| \\serername\share and doesn't mention the rest of the
path or if I use
>| the drive letter that is mapped to the above it shows
just the drive
>| letter in the error message.
>|
>| It seems I can't get to this share.
>|
>| Would using directoryinfo or the one of the file
objects work
>| differently?
>|
>| Thanks,
>| Marc
>|
>|
>|
>| *** Sent via Developersdex http://www.develop...
***
>| Don't just participate in USENET...get rewarded for it!
>|
>
>.
>