How to read app.config for outlook add in
I would like to know following 2 things.
I am using outlook 2007 Add in.
- How to read App setting for deployed outlook plugin.
I have 开发者_开发百科used following things for this to read configuration file.
ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().CodeBase.ToLower().Replace("file:///", ""));
Please let me know if you have better way for this.
2.For calling WCF client i need to load all wcf configuration defined in App.config
EndpointAddress endpointAddress = new EndpointAddress(endPoint.Address);
serviceWS = new serviceWS(new BasicHttpBinding(), endpointAddress);
I would like to load all app.config setting for WCF.
3.Also I would like to know if it is possible to change dll.config deployed on machine and reflect those changes in plugin(make sure plugin read dll.config)
Thanks for help
To answer part one. I put my configurations in the App.config of my Addin
You will need to override ConfigurationSection and you may need to look at ConfigurationElementCollection & ConfigurationElement all in the System.Configuration namespace
The App.config is deployed with the addin so you shouldn't have to do anything fancier than this
var section = (MyAwesomeConfigSection)ConfigurationManager.GetSection("AwesomeConfigSection");
I don't really understand the rest of your question
精彩评论