Configuring log4net with VS2010 and .Net 4.0
来源:互联网 发布:java关键词过滤 编辑:程序博客网 时间:2024/05/28 15:26
Configuring log4net with VS2010 and .Net 4.0
After spending a few hours this morning trying to get log4net working with a project, I decided to share my findings. I chased a lot of dead-ends for what wound up being a fairly simple solution. Here is a quick article to save both myself, and maybe you, some time in the future.
Get Log4Net
Go to http://logging.apache.org/log4net/ and get the latest version. Add the project file to your solution. Then right-click that project, choose the build tab and…
Step 1: Set the log4net conditional compilation symbols replacing NET_1_0 with NET_4_0.
Log4Net Requires Full .Net Access
That means you cannot use “client profile”. log4net was originally written to log web services. As such it expects to have a lot of server-side classes available, even though most of those classes are never instantiated.
Step 2: Build Your Application & The Log4Net component under .Net 4.0, not .Net 4.0 Client Profile
Make Log4Net Less Secure
The .Net 4.0 assemblies are more secure by default. You need to override this. As I’m not a .Net development guru I’m not really certain what the differences mean, but Google is your friend (and mine) here, so if you are concerned (and you should be before launching a public app) then search the Internet to find out what this mean. In the meantime…
Step 3: Make log4net assembly less secure, add
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
to the log4net AssemblyInfo.cs file.
Done.
That’s it, the first steps for getting a log4net component into your application. Now you can follow some of the development & deployment document on the Apache site:
http://logging.apache.org/log4net/release/manual/configuration.html
编译好的for .net 4.0 的log4net库文件下载:
http://download.csdn.net/detail/kingmax54212008/5274223
- Configuring log4net with VS2010 and .Net 4.0
- Configuring log4net for use with NHibernate
- Log4Net with ASP.NET 3.5
- Installing and Configuring Openfiler with DRBD and Heartbeat(HA)--1
- Installing and Configuring Openfiler with DRBD and Heartbeat(HA)--2
- log4net 使用示例|using log4net with asp.net/winform
- Enabling and configuring SAMBA as shipped with Solaris 10
- 《Monitoring with Ganglia》Chapter 2 Installing and Configuring Ganglia
- Configuring a Puppet Master Server with Passenger and Apache
- VS2010 asp.net web site项目使用log4net
- .NET log4net
- vs2010使用log4net
- vs2010 中使用 log4net
- VS2010下使用log4net
- vs2010 中使用 log4net
- vs2010使用log4net
- vs2010使用log4net
- VS2010中log4net配置
- Mysql修改Root密码
- Android下GPS定位<1>
- 深度探索套接字缓冲区(2)
- IOS 自定义VIEW
- Ring简介
- Configuring log4net with VS2010 and .Net 4.0
- yum安装LAMP
- 深度探索套接字缓冲区(3)
- cocos2d-x 随机函数
- "org.apache.struts.taglib.html.BEAN" in any scope
- 1107(数论)
- 使用SVD方法实现电影推荐系统
- Java虚拟机内存管理
- jquery中的简单过滤选择器