Default working directory from within .NET Com wrapper while running VB Script from within Excel.

Alex van Buitenen, 2010

Situation:

Developing a .NET Com wrapper in Visual Studio 2005 and working with Log4Net version 1.2.10.0.
The .NET Com wrapper gets called from within a VB Script using Excel 2002.



Figure 1. The Executable-, Script- and Dll-directories.

A Log4Net appender was configured as having a relative path ("Logs\MyLog.log").
Log4Net places the log file in the directory from where the executable runs.
In this case, that is the C:\Program Files\Microsoft Office\Office10 directory.

That is not the correct place for the log files.
I would like to configure Log4Net to place the log files in the Script or in the Dll directory.
I was not able to do that using the configuration files, but it can be done programmatically.

See Log4Net, changing the filename of an Appender at runtime.