FileStream over mapped network drive

FileStream over mapped network drive

Post by Jean-Michel JACQUE » Sat, 01 Jun 2002 16:56:08



Hi all,

I have problem on a development machine (running Windows
XP and IIS 5.1) under .NET running a WebService that
accesses a mapped network drive.

I get the following error message when trying to use the
service :

System.IO.DirectoryNotFoundException: Could not find a
part of the path
"h:\inetpub\Archigate_Storage\CF013678-8C70-484B-AA68-
B488F161FC30".
   at System.IO.__Error.WinIOError(Int32 errorCode, String
str)
   at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean
useAsync, String msgPath,
Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess
access)
   at AGADMSVC.Storage.RealSize(String storageName) in
c:\inetpub\wwwroot\AGADMSVC\Storage.asmx.cs:line 346
   at AGADMSVC.Storage.GetFileFullInfos(Int32 id) in
c:\inetpub\wwwroot\AGADMSVC\Storage.asmx.cs:line 206

I added "act as part of operating system" to ASPNET user
to allow impersonation as said in Q306158, and <identity
impersonate="true" userName="myuser" password="xxx" /> in
the web.config file. myuser has all rights to access the
mapped network drive with full access (for test only !).

Same WebService works fine on a development machine
running Windows 2000 Professional (same version of .NET
framework and tools), with same mapped network drive, with
same user rights and config.

Of course, there is no problem with path or file that
should be used with FileStream object (both tests under XP
and 2000 Pro uses the same file, over same mapped drive to
the same drive letter).

IUSR_MachineName users are the same on both development
computers and this user has been created locally on file
server (for a previous test using <identity
impersonate="true" /> on both computers with same effect -
Win2000 works fine and XP fails with same error).

Any idea would be very apreciated !

Best regards,

Jean-Michel JACQUEL

 
 
 

FileStream over mapped network drive

Post by Gar » Sat, 01 Jun 2002 18:37:39


Disable the "Anonymous access" option in IIS. Since the Impersonate was
truned on in your ASP.NET application, if the "Anonymous access"  was
enabled, the requests will be run under the IUSR_<MACHINE_NAME> account. By
default, the token o generated by IIS on the IUSR account cannot access
shared resources.

Gary,

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net

 
 
 

FileStream over mapped network drive

Post by Jean-Michel JACQUE » Sat, 01 Jun 2002 19:55:32


Gary,

Thank you for your answer but it doesn't correct the
problem.

Best reagds,

Jean-Michel

Quote:>-----Original Message-----
>Disable the "Anonymous access" option in IIS. Since the
Impersonate was
>truned on in your ASP.NET application, if the "Anonymous
access"  was
>enabled, the requests will be run under the

IUSR_<MACHINE_NAME> account. By
Quote:>default, the token o generated by IIS on the IUSR account
cannot access
>shared resources.

>Gary,

>This posting is provided "AS IS", with no warranties, and
confers no
>rights. Enjoyed ASP.NET? http://www.asp.net

 
 
 

FileStream over mapped network drive

Post by Gar » Wed, 05 Jun 2002 14:55:52


Please refer to another same post you posted.

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net

 
 
 

1. FileStream problem with mapped network drive

Hi all !

I have a problem creating a FileStream object over a
network drive mapped on the server running the app or
WebService.

I have 2 servers : 1 with IIS and .NET Framework , 1
simple file server

When I create the FileStream object in a WebService, I get
the following error :

System.IO.IOException: Logon failure: unknown user name or
bad password.

   at System.IO.__Error.WinIOError(Int32 errorCode, String
str)
   at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access, FileShare share, Int32
bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access)
   at AGADMSVC.Storage.RealSize(String storageName) in
c:\inetpub\wwwroot\agadmsvc\storage.asmx.cs:line 346

I think the problem is due to ASP.NET account because I
have to logon to the file server to access the files or
folders stored on it.

So, how can I set user name and password to user when
creating FileStream object ?

Any idea ?

Best regards

2. Problem with BuildSecurityDescriptor funcion on CW5.3

3. FileStream over mapped network drive problem

4. cisco routers

5. FileStream with mapped network drive

6. Recommendations as to why we need NTP

7. map a network drive

8. deleting icons

9. Map a network drive

10. Wrong zone for mapped network drive

11. Map drive on the device to a network share

12. Map drive to network

13. Mapping network drive thru SW