Correct way to reference log4net DLL in WinForms application

后端 未结 3 959
你的背包
你的背包 2021-01-28 02:36

My WinForms 2.0 application has 2 assemblies. 1st assembly handles GUI and project specific code, and 2nd assembly is where I put all my reusable code. Both projects are part of

相关标签:
3条回答
  • 2021-01-28 03:13

    I usually build the project and put the log4net dll in a libs folder which is a solution folder. Both projects reference this dll (libs folder).

    0 讨论(0)
  • 2021-01-28 03:13

    Learn to rely on NuGet, it will automatically manage your dependencies and store them in proper folder.

    As for log4net, the compatibility has already been broken because of messed keys and broken method contracts. No one knows how to resolve this mess:

    http://netpl.blogspot.com/2012/03/pathetic-breaking-change-between.html

    0 讨论(0)
  • 2021-01-28 03:24

    should I copy the log4net.dll file into each project directory?

    No. Keep it at separate dependencies folder. This folder should be common for all projects in Solution. You should reference log4net.dll into each project (that require this component).

    Or should I also add the entire log4net source code project as part of the solution, so that I am insulated from any future changes in log4net breaking my existing application?

    It is not required. It is required only if you are facing any issues in log4net.dll and want to diagnose yourself.

    0 讨论(0)
提交回复
热议问题