问题
I'm launching a lengthy import on a new thread in an ASP.NET page.
Everything is working fine except that I get a failed IO permission when I try to write to my log file from the worker thread, which is not a problem in the primary thread.
I am using IIS7 integrated mode without impersonation, although I got the same results with impersonation in classic mode.
The problem is almost identical to this one, only I have no Response.Redirect and see no applicable fix in the accepted answer.
EDIT: I need to solve this without reconfiguring server permissions. Adequate permissions are already in place, and I have no access to this on the target machine anyway.
回答1:
Try to give the IIS_WPG group access to your logfile.
Your request probably runs with the account you defined for 'anonymous access' while to worker thread runs as 'network service'.
来源:https://stackoverflow.com/questions/778606/thread-permissions-in-asp-net