I have a C# WPF application that is experiencing a weird issue. The app uses the MS Enterprise Library (Logging) which is configured using the app.config. My deployed files hence are:
(names changed, filename lengths correct)
XXXXXXXXXXX.EXE
XXXXXXXXXXX.EXE.CONFIG
Normally this works just fine. However, in one bizarre situation the app is launched by another program that calls the EXE based on it's shortname (XXXXXX~X.EXE). The EXE starts but then proceeds to look for an app.config that doesn't exist (XXXXXX~X.EXE.CONFIG ) and the Logging class fails to initialize.
I can't change the program that launches us so I'm trying to figure out ways guarding against this in my WPF code. Thoughts are...
1) Rename my EXE and create a man in the middle EXE.
2) Detect how my EXE was launched and relaunch it correctly.
3) Some kind of AppDomain / ConfigurationManager repointing ( Is this possible? )
4) Use the installer to clone the App.Config to the short file name version (confirmed works)
Has anyone ever seen this before and have any suggestions / insight?