FileExists returns false for remote files when run under IIS



My solution has ASP.NET app , .NET dll and a Web Service .
The ASP.NET application calls to WebService’s methods , which calls
the dll’s methods .
One of the functions of the dll is accessing files , which are located
on different computer. The path is UNC path and it exists . It has the
following code :

If My.Computer.FileSystem.FileExists(Path) Then
‘ read the image
End if

If the application is run directly from Visual Studio 2008 , it works
just fine and the FileExists returns true.
However, the same code running on the same machine under IIS fails.

When I had problems accessing some files on local machine before , I
simply assigned ASPNET user to those directories , and it worked
fine .

However, since the files that should be accessed in the dll are
located on different machine, I can not do this .
I believe this is something to do with permissions.
It looks like I need to use ASP.NET impersonation. Is that right ? Is
there any good totorial explaining ALL steps that should be done ?
I found out that I need to add the “identity” line in my Web.Config .
I did it as following , but it didn’t help :
<configuration>
<system.web>
<identity impersonate="true" userName="my user name" password="the
user password"/>
</system.web>
</configuration>

My questions are :

What should I do in addition to writing this “identity" line in
Web.Config ?
I use FORMS ASP.NET authentication . Is that OK ?
What IIS Authentication should I use? Where I define it ?
If I use impersonation, what user name should I use? Where it should
be configured and what roles / permissions it should have?
Should it be domain user? Local User?
What config files should I change ( Web.Config , Machine.config ?
Something elase ? )


Any advices would be appreciated !!!!

Thanks , Orit .


.



Relevant Pages

  • Can not access remote files from WebService
    ... .NET dll and a Web Service. ... What IIS Authentication should I use? ... If I use impersonation, what user name should I use? ...
    (microsoft.public.dotnet.framework.webservices)
  • Can not access files on different computer
    ... My solution has an ASP.NET app, a Web Service and a NET dll. ... What IIS Authentication should I use? ... If I use impersonation, what user name should I use? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: MSTest with codecoverage - attempts to instruments DLLs it cant
    ... of the assembly use some unmanaged DLL, ... Generally for the Instrumentation and Code coverage, ... save a copy of the configuration file. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.vsnet.general)
  • Re: Configuration for DLL
    ... The classes in the DLL will be used by VBScripts. ... How can I get it to look at the installation directory? ... assembly is called "MyConnection.dll" create a configuration ... Add your connection string to it: ...
    (microsoft.public.dotnet.general)
  • Re: how to add relase mindependency configuration in VS.NET ?
    ... In MinSize configuration, your executable links against ATL DLL and CRT ... redistribute your dependencies to the users' machines, ...
    (microsoft.public.vc.atl)