Thursday, January 05, 2012

Visual Studio and log4net

One of the projects here at Sapiens, required me to add logging to AddOn for the Word. I googled the subject and found a good logging framework, log4net. It is very similar to log4j if one is working with Java, so no surprises there. At first, I had a bit of difficulty on how to initially setup this, but I found a good post on this blog and a few other places. What this blog was missing is that once you download log4net, you need to decide which DLL you want to use, or otherwise, you will get compilation error. You can decide by going to Project->Properties->Application and under Target framework, you will find what is your current setting. You can then navigate to proper DLL.

Also, what I changed is location of my log, and added ${TMP}\myfile.log instead what original author put in place.

For all those experienced in Visual Studio, this would probably not be a problem, but I am a Java developer so this kind of post would help me :).

No comments:

Post a Comment