Hello.
I'm trying to write to text file from WCF application, using stream writer and text writer.
I have 2 consumers to the WCF: console application and classic ASP.
Using WCF from console app - the txt file is created and all OK.
Using WCF from classic ASP - I get:
"System.UnauthorizedAccessException: Access to the path 'c:\AAA.txt' is denied."
Why is this?
Thanks.
Unauthorized Access to txt file by .Net or COM
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Subhendu DeRank #1,108 · 1.7K reputationPosted Dec 13, 2010, 4:42 AM EST
Elvis8 reputationPosted Dec 13, 2010, 5:21 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Dec 13, 2010, 8:28 AM EST
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
ASPNETorNETWORK SYSTEMuser if your WCF service is hosted in IIS, or by the user the NT Service hosting your WCF service is running under.