Attilah
Attilah

Reputation: 17930

WCF Access to path denied

I'm using an ASP.NET to call my WCF service. in my service, I access a file but I get this exception :

FaultException '1 was not handled by user code : Access to the path 'C:\Users\attilah\Documents\Visual Studio 2008\Projects\at\att\UploaderTemp\attilah\file1.pdf' is denied.

Upvotes: 0

Views: 6190

Answers (3)

HDD
HDD

Reputation: 161

Just a heads up, it just happened to me: If you're configuring a shared folder, be sure to set the permissions for the folder AND the share, I spent some many hours until I realized this...

Upvotes: 0

user273028
user273028

Reputation: 41

There is file access audit in Windows. You can use it to get detailed info about access faults. All events will be collected into Security Event Log. Steps to achieve:

  1. Define audit on the "C:\Users\attilah\" directory or whole disk via Property->Security->Audit
  2. Switch on audit in the Local Security Policy (Control_Panel->Administrative_Tools)
  3. Look for events in the Security Event Log

Second method is using Process Monitor by Mark Russinovich (www.sysinternals.com)

Upvotes: 0

marc_s
marc_s

Reputation: 754408

The message is pretty clear - the process that's trying to read the file is not permitted to do so.

Mind you - when you call a WCF service, the access to the file will not be made under your own identity (as the caller) - it'll be made by either the ASPNET or NETWORK SYSTEM user if your WCF service is hosted in IIS, or by the user the NT Service hosting your WCF service is running under.

Does any of those limited system account have access to that file on disk on your server?? Most likely not...

Upvotes: 4

Related Questions