I would like to create a separate log file for a C# com server dll I load into Excel.
However, when I set up my logger I need to tell it where the assembly.dll.config
file is. This config
file is located in C:\Program Files (x86)\My Company Name
but I don't know how to get this path in a dynamic way at runtime and I don't want to hard code it for obvious reasons.
I tried to use:
AppDomain.CurrentDomain.BaseDirectory + "assembly.dll.config"
but this just gives me Excel's install directory:
C:\Program Files (x86)\Microsoft Office\Office14\assembly.dll.config
Is there some way I can get the path of the dll's config file at runtime?