I want to run a program with different configuration file, the program write with C# 2.0, I make some different file name {program_name}.exe.config, I mean one exe with different config file, for example I have 3 config file, then I will run 3 exe with the different config file, bu the exe file is the same one.
Can I do not modify the program for read the different config file (I don`t want to put the config file path in the exe command parameters) to do that(like use the batch file or other method.) ?
Thanks.
The main issue you have with three configs and one executable is that you need to specify to the executable which config to use.
One option is to make 3 copies of your executable,
exe1.exe,exe2.exeandexe3.exeand have a similarly named config for each –exe1.exe.config,exe2.exe.configandexe3.exe.config.When running each executable, it will use the correct config.
Another option is to have several batch files that will rename the different config files according to which one you want to use. Then you have a single exe and three configs.