log4net - Appenders not working in IIS7.5

前端 未结 7 1149
再見小時候
再見小時候 2020-11-29 06:39

I am able to write to a log file using log4net and Cassini/IIS dev server, but when I use IIS7.5, I can\'t write out to a file.

Initially, I got a security exception

7条回答
  •  天涯浪人
    2020-11-29 07:37

    I had this same problem. I solved it by changing the IIS 7 configuration. Rather easy...

    Go to the application pool advanced settings and set "Load User Profile" to true! Then make sure that IUSR (IIS user) have permission to write to the logs path.

    Additionally, usually, I add support for 32 bit applications, this is useful when you download and use assemblies from 3rd parties, where you don't know if they were complied for 32, 64 or independent.

    I found this by reading this article: http://learn.iis.net/page.aspx/624/application-pool-identities/

    Best regards, Tiago.

提交回复
热议问题