Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: when to use strong name confusion
Prev Next
You are not authorized to post a reply.

Author Messages
hdjim69

10/30/2008 1:53 PM  

Hello,

 

Not sure I understand the strong name requirements.  I'm on .Net 2.0.  There is already a .dll in the log4net-1.2.10\bin\net\2.0 dir. Do I need to rebuild this .dll with a strong name key or can I just use this dll as it is ?    I know what a strong name is and how to generate a private/public key but still not sure how this relates to when and why I would need to do this with log4net.

 

Any help would be appreciated.

 

TIA

J


Walden H. Leverich

10/30/2008 2:45 PM  

Is this for _internal_ use? IOW, you're not a ISV getting ready to distribute software, right? In that case, just ignore strong names completely. Use the DLL as it, and don't worry about sn.exe or signing at all. Except in rare cases (and you'll know when you get there) there is no point in using strongly named assemblies internally.

 

If you're an ISV, then consider it, but then you'll have to understand strong names for your own stuff and the log4net stuff will seem obvious.

 

-Walden

 

--

Walden H Leverich III

Tech Software

(516) 627-3800 x3051

WaldenL@TechSoftInc.com

http://www.TechSoftInc.com

 

Quiquid latine dictum sit altum viditur.

(Whatever is said in Latin seems profound.)

 

hdjim69

10/30/2008 3:04 PM  

Yes, this is for internal use.  We are not a vendor. However we have several projects in the solution (VS2005) that need to log (client.exe, client.dll, server.dll, etc.).  I just want to be able to go into each project and add a reference to the log4net.dll and that should do it.  No GAC just a reference in each project to the log4net.dll.
 
Is this the correct way to set up referencing this .dll?

Reineri, Jim

10/30/2008 3:44 PM  

Yes, just reference the dll in your project and include it with the app when you deploy.

Walden H. Leverich

10/30/2008 3:50 PM  

> just want to be able to go into each project and add a reference to the log4net.dll and that should do it. 

>No GAC just a reference in each project to the log4net.dll.

 

Correct. _IF_ you used the signed version (or signed a build yourself) you could drop it in the GAC and then you wouldn't need a copy in each deployment directory (you'd still need a reference) but we've found the GAC closer to DLL-hell then not. It's simple enough to drop a copy of log4net.dll in the deployment directory and away you go. Plus, if you were to use a strongly named version then every time you rebuilt it you would have to adjust your references as the full version # is included in the strong name. Not the end of the world for log4net.dll, but there are updates.

 

-Walden

 

--

Walden H Leverich III

Tech Software

(516) 627-3800 x3051

WaldenL@TechSoftInc.com

http://www.TechSoftInc.com

 

Quiquid latine dictum sit altum viditur.

(Whatever is said in Latin seems profound.)

 

Reineri, Jim

10/30/2008 4:05 PM  

This is exactly right.  The only downside of deploying unsigned log4net with each application is that you would end up with a copy of the dll in each deployed application.  At < 300k that is a very small downside in most situations.

 

Jim

hdjim69

10/30/2008 4:32 PM  
Great!  Now comes the question, what about project reference vs. file reference? MSDN recommends using project references whenever possible and only use file references when necessary. 
 
I haven’t been using .Net that long and I’m still a little fuzzy on all the setup choices.  We’re on VS2005 using Team Suite.  The source is on a dev server and we download local copies to develop.  When done, we diff, the check into the server. Then Q&A does a build.
 
I’m in charge of requirements gathering and setup for Log4Net.  So, I should add a new project to our solution and add the Log4Net code and set a reference to this project from all the other projects in the solution that we need to use Log4net to log. Then do a build, and save my solution and check in the new project.  When my co-workers “get latest” it should pull down the new project and all the existing projects should now have a reference to the Log4Net dll that was built. 
 
If so, I really don’t need the .dll that came with the Log4Net download since I’m going to rebuild it anyway when I add the project and build it.  Is this the way to do this? 
 
TIA
 

Walden H. Leverich

10/30/2008 5:46 PM  

What you describe vis-a-vie the build process is indeed the difference between a file reference and a project reference. The two nice things about a project reference is that when you build debug you reference the debug version of the other project, but when you build release you reference the release version of the other project. And when you build, you rebuild the other project if needed.

 

For me, business object / data layer references would probably be project references for my client project, but something like log4net, or a 3rd party control would be file references. I don't really want debug builds of the 3rd party DLLs, and I don't need to step into them in debug mode or have them rebuilt every time.

 

We add a "_Binaries" directory to our projects where we can place 3rd party stuff and reference it from there. That way if it does change the change can be checked into the _Binaries directory and then it will be picked up on the next build.

 

-Walden

--

Walden H Leverich III

Tech Software

(516) 627-3800 x3051

WaldenL@TechSoftInc.com

http://www.TechSoftInc.com

 

Quiquid latine dictum sit altum viditur.

(Whatever is said in Latin seems profound.)

 

hdjim69

10/30/2008 6:19 PM  

Walden, so you create a directory at the Solution level?  Right-click solution -> Add -> New solution folder?  Name it Binaries. Then right-click on the newly added Binaries folder and select Add-> New Item and select the log4net .dll (release version) ?  from the path it was installed when I downloaded it?

 

A few things…

 

I did that and I looked in the dir that contains my solution and all it’s project sub-folders but I did not see the new Binaries folder.

 

I see the new folder and the log4net.dll in the Solution but I don’t see it in the dir. that contains my solution so how do I add a reference to this dll from all my other projects?  I still have to point to the path where it was installed when I downloaded it??  So how does the .dll in the new folder get mapped to the other projects?  It seems like there is no relationship between the new folder with the .dll and the actual locatoin of the .dll that I have to select when I add reference in the other projects

 

I’m confused….  I swear MS can really complicate things.  And I hate all this behind the scenes stuff…I’d rather be responsible to set everything myself then let VS do it because you really don’t know what it’s doing….

Walden H. Leverich

10/30/2008 6:36 PM  

We're not using Team edition, we're subversion based. So I just created the directory in explorer and added it to SVN. The VS solution knows nothing about the directory, and the individual projects just reference the DLLs directly from the directory with copy-local set to yes.

 

-Walden

 

--

Walden H Leverich III

Tech Software

(516) 627-3800 x3051

WaldenL@TechSoftInc.com

http://www.TechSoftInc.com

 

Quiquid latine dictum sit altum viditur.

(Whatever is said in Latin seems profound.)

 

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > when to use strong name confusion



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement