Log4net reference assembly dependency issue

This question already has an answer here:

  • Log4Net in WCF not working 4 answers

  • UPDATE :

    If you're still getting this error, you're using an out-of-date version of log4net and you should consider updating to the current version, which does not require the full .NET 4.0 framework. Thanks to @Philippe for pointing this out in a comment.


    Your project is referencing the .NET 4.0 client profile which does not include System.Web; you actually need to reference the full framework.

    See How To: Target a Specific .NET Framework Version or Profile on MSDN for directions.

  • In Visual Studio, open the project you want to change.
  • Right-click the project in Solution Explorer and then click Properties.
  • In the Project Designer, locate the Target Framework list, as follows.

  • For Visual Basic projects, click the Compile tab and then click Advanced Compile Options. The Target Framework list is in the Advanced Compiler Settings dialog box.
  • For Visual C# projects, the Target Framework list is on the Application tab of the Project Designer. For more information, see Application Page, Project Designer (C#).
  • For Visual F# projects, the Target Framework list is on the Application tab of the Project Designer.
  • In the Target Framework list, select the .NET Framework version or profile that you want. When you click OK, the project unloads and then reloads in the integrated development environment (IDE). The project now targets the .NET Framework version that you just selected.

  • Possibly also of interest is Troubleshooting .NET Framework Targeting Errors.


    将项目设置为在“项目属性”对话框中定位“.Net 4.0 Framework”,而不是“.Net 4.0 Framework Client Profile”。


    Just small update. This issue has been logged almost 3 years ago and was fixed just this month. So next version of log4net (after 1.2.10) should be fine to work with client profile frameworks.

    https://issues.apache.org/jira/browse/LOG4NET-174

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

    上一篇: log4net与ASP.NET MVC:没有任何反应

    下一篇: Log4net引用程序集依赖项问题