can't create directory from web service

M

Marc Pensa

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
 
L

Lewis Wang [MSFT]

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/?id=306158


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" <[email protected]>
| Sender: "Marc Pensa" <[email protected]>
| Subject: can't create directory from web service
| Date: Wed, 3 Sep 2003 14:49:56 -0700
| Lines: 13
| Message-ID: <[email protected]>
| 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
|
 
L

Lewis Wang [MSFT]

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 <[email protected]>
| References: <[email protected]>
| 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: <[email protected]>
| 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
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
M

Marc Pensa

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
 
L

Lewis Wang [MSFT]

Hi Marc,

It seems that there is no permission for the web service to access the
sharing folder, but it can access the drivers on the remote machine.

What's the permission list of the sharing folder? Please make sure that the
standard service user id which has domain auth has the permission to access
the sharing folder.You can try to logon the server using this user id and
access the sharing folder using IE. Does it succeed?

Hope this helps.

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" <[email protected]>
| Sender: "Marc Pensa" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: can't create directory from web service
| Date: Tue, 9 Sep 2003 07:39:25 -0700
| Lines: 98
| Message-ID: <[email protected]>
| 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: AcN24CqYs8b1NjWmSa6OujEu0TAgIw==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19274
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| 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 <[email protected]>
| >| References: <[email protected]>
| >| 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: <[email protected]>
| >| 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.developersdex.com
| ***
| >| Don't just participate in USENET...get rewarded for it!
| >|
| >
| >.
| >
|
 
M

Marc Pensa

The permissions list for this share only has "everyone"
listed and everyone has full authority.

I signed on to the server with the service user id and I
could access, create and delete directories with in the
share. I expected this as it works when I use the drive
letter and dollar sign (admin share?).

There seems to be some interference when accessing this
share from with in asp on this server. It works fine when
running under localhost on my machine. I have the same
changes in machine config. We develop all our web
services to run using the service user id.

The server is a windows 2000 server with service pack 4.
I am running under frameowrk 1.1. I did not install
framework 1.0 on this server.

I really appreciate your responces. While I have a work
around, I want to know why it does not work using the
share as this is our preferred method of accessing these
directories.

Thanks,
Marc
 
L

Lewis Wang [MSFT]

Hi Marc,

I should say this is a weird issue. I can't reproduce it, but I will do
more research for you.

Have you tried to deploy the web service on another machine and reproduce
it?

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" <[email protected]>
| Sender: "Marc Pensa" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: can't create directory from web service
| Date: Wed, 10 Sep 2003 07:33:30 -0700
| Lines: 198
| Message-ID: <[email protected]>
| 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: AcN3qIF0DFfCp0zkRBqnUK8h6MIvbQ==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19295
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| The permissions list for this share only has "everyone"
| listed and everyone has full authority.
|
| I signed on to the server with the service user id and I
| could access, create and delete directories with in the
| share. I expected this as it works when I use the drive
| letter and dollar sign (admin share?).
|
| There seems to be some interference when accessing this
| share from with in asp on this server. It works fine when
| running under localhost on my machine. I have the same
| changes in machine config. We develop all our web
| services to run using the service user id.
|
| The server is a windows 2000 server with service pack 4.
| I am running under frameowrk 1.1. I did not install
| framework 1.0 on this server.
|
| I really appreciate your responces. While I have a work
| around, I want to know why it does not work using the
| share as this is our preferred method of accessing these
| directories.
|
| Thanks,
| Marc
| >-----Original Message-----
| >Hi Marc,
| >
| >It seems that there is no permission for the web service
| to access the
| >sharing folder, but it can access the drivers on the
| remote machine.
| >
| >What's the permission list of the sharing folder? Please
| make sure that the
| >standard service user id which has domain auth has the
| permission to access
| >the sharing folder.You can try to logon the server using
| this user id and
| >access the sharing folder using IE. Does it succeed?
| >
| >Hope this helps.
| >
| >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" <[email protected]>
| >| Sender: "Marc Pensa" <[email protected]>
| >| References: <[email protected]>
| ><[email protected]>
| ><[email protected]>
| >| Subject: Re: can't create directory from web service
| >| Date: Tue, 9 Sep 2003 07:39:25 -0700
| >| Lines: 98
| >| Message-ID: <[email protected]>
| >| 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: AcN24CqYs8b1NjWmSa6OujEu0TAgIw==
| >| Newsgroups:
| microsoft.public.dotnet.framework.aspnet.webservices
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| >microsoft.public.dotnet.framework.aspnet.webservices:19274
| >| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| >| X-Tomcat-NG:
| microsoft.public.dotnet.framework.aspnet.webservices
| >|
| >| 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 <[email protected]>
| >| >| References: <[email protected]>
| >| >| 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: <[email protected]>
| >| >| 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.developersdex.com
| >| ***
| >| >| Don't just participate in USENET...get rewarded for
| it!
| >| >|
| >| >
| >| >.
| >| >
| >|
| >
| >.
| >
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,609
Members
45,254
Latest member
Top Crypto TwitterChannel

Latest Threads

Top