Unable to use Log4Net with .net Framework 4

We are planning to use Log4net in our application . But I am unable to import the "log4net" namespace if the target framework is 4.

I also get a warning The referenced assembly "log4net" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

So what is going wrong here ?

Note-Logging works if I change the target framework to 3.5 Note-This is a windows application .

Thanks in Advance.


在项目属性页面上将目标框架从.NET Framework 4 Client Profile更改为.NET Framework 4


See here for your answer:

log4net with .NET 4.0


Please see this SO post: Log4Net and .NET 4.0

It has an answer that points to a solution here: http://krishnabhargav.blogspot.com/2010/02/using-net-35-clr-20-dll-inside-visual.html

链接地址: http://www.djcxy.com/p/43652.html

上一篇: log4net不记录并抛出错误

下一篇: 无法将.Net Framework 4与Log4Net结合使用