[英]ASP.net C# Log4net not working. Properties folder missing
I had a working log4net which stopped working after I rearranged my sheets into folders. 将工作表重新排列到文件夹中后,我的log4net正常工作,但无法正常工作。 Then everything wen crazy.
然后一切都疯了。 The log4net was not recognized anymore.
log4net不再被识别。 I added some xml from a tutorial and then the errors stopped.
我从教程中添加了一些xml,然后错误停止了。 The logging didn't start though.
日志记录没有开始。 I have decided to scrap everything.
我决定放弃一切。 I have deleted all traces of log4net and am following this tutorial now.
我已经删除了log4net的所有痕迹,并且正在关注本教程。 Stuck at step one though.
卡在第一步。 :( I do not have a properties folder or my assemblyinfo.cs file.
:(我没有属性文件夹或我的assemblyinfo.cs文件。
Please help me with this logging functionality. 请帮助我使用此日志记录功能。
Why not just add a properties folder and AssemblyInfo.cs
file? 为什么不只添加属性文件夹和
AssemblyInfo.cs
文件? Create a new project and copy the default AssemblyInfo.cs
file from there as a template. 创建一个新项目,并从那里复制默认的
AssemblyInfo.cs
文件作为模板。 Or you could add the XmlConfigurator.Configure();
或者,您可以添加
XmlConfigurator.Configure();
statement to your Application_Start
method in global.asax.cs
. 对
global.asax.cs
的Application_Start
方法的声明。
protected void Application_Start()
{
XmlConfigurator.Configure();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.