UnauthorizedAccessException in webservice accessing files on UNC s

Discussion in 'ASP .Net Security' started by Robert Altland, Sep 15, 2005.

  1. 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?
     
    Robert Altland, Sep 15, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Baron
    Replies:
    3
    Views:
    5,885
    Scott Allen
    Apr 29, 2005
  2. flipdoubt

    Accessing a file at a UNC

    flipdoubt, Sep 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    436
    flipdoubt
    Sep 10, 2005
  3. Chris Newby
    Replies:
    2
    Views:
    8,556
    JIMCO Software
    Sep 9, 2005
  4. Anbu
    Replies:
    4
    Views:
    47,501
  5. Replies:
    0
    Views:
    787
Loading...

Share This Page