Reputation: 1266
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,
Upvotes: 0
Views: 6103
Reputation: 48230
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
Upvotes: 1
Reputation: 30698
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.
Upvotes: 0
Reputation: 2919
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).
Upvotes: 2