web service in .net cannot access files on net work drives

  • Thread starter Nalina Vemparala via .NET 247
  • Start date
N

Nalina Vemparala via .NET 247

Hi!
I am creating a web service in which the web method makes call to a function in which I have to read some files on the network drives. I used the unc path to access this file.
I am getting an error the file doesn't exist or the path to this file doesn't exist.
I tried to map the network drive and tried using the absolute path still doesn't work.
The same code works in a windows application. But If I access this code through web service this error appears.
Could anyone please help me with this.
Your help is much appreciated
 
D

Dino Chiesa [Microsoft]

It's likely a security restriction.
ASP.NET webservices run under a different account than "you".

Perhaps "you" have access to the network asset, but the ASP.NET account does
not.

Couple of approaches:
run ASP.neT under an account that has greater access (not recommended)
enable the ASP.NET account to access that network resource (preferred)


--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ ElideThis . m i c r o s o f t . c o m

Nalina Vemparala via .NET 247 said:
Hi!
I am creating a web service in which the web method makes call to a
function in which I have to read some files on the network drives. I used
the unc path to access this file.
I am getting an error the file doesn't exist or the path to this file doesn't exist.
I tried to map the network drive and tried using the absolute path still doesn't work.
The same code works in a windows application. But If I access this code
through web service this error appears.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top