A problem regarding dll inheritance

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-04-22T00:34:09Z Indexed on 2010/04/22 0:43 UTC
Read the original article Hit count: 241

Filed under:
|
|

Hello all

I have created a dll that will be used by multiple applications, and have created an installer package that installs it to the program files, as well as adds it to the Global Assembly Cache.

The dll itself uses log4net, and requires a xml file for the logging definitions.

Therefore when the installer is run, the following files get copied to the install directory within program files: The main dll that I developed - The Log4Net.dll - the Log4Net.xml file

I am now experiencing a problem. I have created a test console application for experimentation. I have added my dll as a reference, and set the 'local copy' flag to false.

When I compile the test console exe however, I noticed that it has copied the log4net.dll and log4net.xml files to the bin directory. And when running the test console, it appears that it will only work if the log4net.dll is in the same directory as the exe. This is dispite the fact that the test console application does not use log4net, only the dll that was added as a reference does.

Is there some way to have it so that the log4net.dll & xml files used will be the ones that were installed to the program files, rather than any application needed to copy over local copies? The applications that will be using my dll will not be using log4net, only the dll that they are referencing uses it.

Many thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about dll