log4net will not create logfile on Windows 7

前端 未结 1 543
粉色の甜心
粉色の甜心 2021-01-19 05:20

I have an assembly that uses log4net for logging.
I have this in the Assemblynfo.cs file:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = \"log4ne         


        
相关标签:
1条回答
  • 2021-01-19 05:51

    This is a permission issue. In Windows 7 you require administrator rights to write to the Program Files directory. You will have to either:

    • Run your application as Administrator
    • Or the preferred way write your log file to a folder where user has write access to.

    To find the correct location to write to refer to: Where to store Application Data in Windows 7 and Vista

    0 讨论(0)
提交回复
热议问题