正确的方法来引用WinForms应用程序log4net的DLL [英] Correct way to reference log4net DLL in WinForms application

查看:158
本文介绍了正确的方法来引用WinForms应用程序log4net的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WinForms 2.0的应用程序有2集。第一次装配处理的GUI和项目特定代码,第二组装是我把我所有的可重用代码。这两个项目是解决方案的一部分;第一个项目引用第2项目。



现在两个项目需要引用log4net.dll文件。我要补充的每个项目指向的地方,我已经下载log4net的源代码,并建立了它的文件夹的引用;或者我应该在log4net.dll文件复制到每个项目目录?



或者我应该还添加整个log4net的源代码项目作为解决方案的一部分,让我从log4net的打破我现有的应用程序的任何未来的变化绝缘?



其中的一个要求是在log4net的未来版本的变化具有打破现有代码的潜在风险,应该有最低我的项目的影响。



什么是最好的做法是什么?



我使用C#2.0。



谢谢,


解决方案

我应该复制log4net.dll文件到每个项目目录?




没有。保持它在不同的文件夹的依赖。此文件夹应该在解决方案的所有项目是共同的。你应该log4net.dll引用到每个项目(需要此组件)。




或者我应该还添加整个log4net的源代码项目作为该解决方案的一部分,所以,我在log4net的打破我现有的应用程序的任何未来的变化绝缘?




它不是必需的。它是必需的仅在您在log4net.dll遇到的任何问题,并要自行诊断。


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 the solution; 1st project references the 2nd project.

Now both the projects need to reference the log4net.dll file. Should I add a reference in each project pointing to the folder where I have downloaded log4net source code and built it; or should I copy the log4net.dll file into each project directory?

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?

One of the requirement is that future version changes in log4net which have potential risk of breaking existing code, should have minimum impact on my projects.

What is the best practice?

I am using C# 2.0.

Thanks,

解决方案

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.

这篇关于正确的方法来引用WinForms应用程序log4net的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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