Frank said:
How can I force an .EXE to use a different app.config file?
For instance, I have an MyApp.exe which by default uses
MyApp.exe.config file. Can I force it to use ThatApp.exe.config?
You _could_ create a small .NET startup EXE which takes the other EXE and
your preferred config file as command line parameters... then create a new
app domain in the small config file, load the other EXE into the new app
domain, reset the config file to the preferred config file for that app
domain, then execute the Main command in the loaded EXE file.
But I wouldn't waste my time, personally, as I'm not sure what advantage
that would grant. Maybe you're trying to start multiple versions of an exe
each with a different configuration? You could have multiple directories,
each with a different config, but the same EXE, or you could pass the
alternate config file on the command line and parse it "manually" (which
really is easy since it's XML anway.)
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]