Reputation: 18127
I am running .NET console application from shared network folder on several Windows 2008 machines and would like to have separated app.config file for every Windows 2008 machine on which console is run. What is the best method to do that?
Upvotes: 1
Views: 1332
Reputation: 49290
You have some options, which depend upon whether you can change and recompile the console application or not:
AppDomain
. This allows you to specify a custom path/filename for the app.config for the new application domain. Shameless plug: https://stackoverflow.com/a/3633158/21567. Note that this approach is not limited to executing your own assembly inside the new application domain. You could also write a managed stub application that just does an ExecuteAssembly
on the console application you really want to run (which may not be able to change), providing it a custom app.config.Upvotes: 1