开发者

Startup same .exe file with different app.config 's

I开发者_如何学Pythons there a way (maybe from command line) to start the same exe file twice using a different app config?


var configMap = new ExeConfigurationFileMap();
configMap.ExeConfigFilename = @"myconfigpath";
var config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);


Start it from a separate location, where the filename.exe.config is different.


THe configuration framework let you load the config from any file but you will have to handle that manually from within your application.

Look at ConfigurationManager class


You can load your process into a separate app domain. This allows you to redirect the configuration file. See http://www.codeproject.com/KB/IP/HostingMultipleServices.aspx for an example of doing this with a Windows service. It'll be similar for any kind of application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜