Reputation: 17930
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
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
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:
Second method is using Process Monitor by Mark Russinovich (www.sysinternals.com)
Upvotes: 0
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