log4net的紧凑框架3.5否的app.config添加文件追加程序 [英] log4net compact framework 3.5 No app.config to add file appenders

查看:201
本文介绍了log4net的紧凑框架3.5否的app.config添加文件追加程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用CF 3.5 VS 2008移动6窗户log4net的。

I am developing a log4net using CF 3.5 VS 2008 on windows mobile 6.

我在我的Windows XP应用程序之前使用log4net的,我总是把配置在app.config文件。

I have used log4net before in my windows xp applications, and I always put the configuration in the app.config file.

不过,这是一个使用log4net的使用CF3.5我的第一次。而且我注意到,没有app.config文件,当我尝试添加一个新的项目有一个没有模板。我在这里丢失的东西吗?

However, this is my first time using log4net with CF3.5. And I have noticed there is no app.config file, and when I try to add a new item there is no template for one. Am I missing something here?

如果3.5没有一个app.config文件。我在哪里可以把我的log4net的配置?我想利用这个文件appender到log4net的,并保存在日志中,其中应用程序是从执行的目录。

If 3.5 doesn't have a app.config file. Where can I put my log4net configuration? I would like to log4net using the file appender and save the log in the directory where the application is executing from.

任何建议非常感谢,

推荐答案

Compact Framework不支持的app.config文件,但你可以模仿这种行为。

Compact framework does not support app.config files but you can emulate such behavior.

创建与设置,然后读取该文件的内容的XML

Create a xml with setting and then read content of that file.

我发现这个变通方法,为我工作:

I found this workaround that work for me:

http://www.eggheadcafe.com/articles/dotnetcompactframework_app_config.asp

这篇关于log4net的紧凑框架3.5否的app.config添加文件追加程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆