UnauthorizedAccessException in webservice accessing files on UNC s

R

Robert Altland

I've been trying to find a solution to my problem and ran across this post on
..NET 247 that describes it exactly:
--------------------------------------------------------------
I am in the process of developing a webservice which [accesses files from a]
UNC path. The problem I am having is accessing the files on the UNC path to a
remote machine within the same domain and on the same network. The error is
System.UnauthorizedAccessException "Access to the path
'\\server\sharename\folder' is denied. If the UNC path points to a folder on
the server running the Web Service everything is fine. For test purposes the
group "everyone" has full access to the UNC Share. I have tried "<Impersonate
/>" without success.

I'm using the System.IO namespace to access the files on the given UNC path.

----------------------------------------------------------------
I followed the various directions in the post to no avail. This webservice
is running in a separate application pool as Network Service on my local
machine, which is running 2003 Server. The UNC share resides on a 2003 Server
within the domain.

This post recommended using the .NET Confiuration tool to give the
localintranet code group full trust. I did that but it didn't work. I've also
created a new code group granting full trust to all assemblies originating
from the webservice URL and that didn't work.

It may be helpful to note that I can successfully query the existence of a
file through File.Exists(), I just can't create a stream.

So to sum up, the webservice is running on my local machine with full trust,
the UNC share is totally wide open and it's still throwing unauthorized
access exceptions when attempting to create a FileStream.

I'm ready to supply any additional information to help diagnose and fix
this. Any ideas?
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top