Pregunta

we have built an Office Addin implementing the IDTExtensibility2 Interface (and the IRibbon... and Taskpane) the Addin is using a Webservice whos binding should be configured via the App.config of the Addin.dll... we now found out that the binding has either be created manually by configuring everything directly in C# or the config settings have to be written in the targetApp.exe.Config - which is in our case Windword.exe.config. This is not a clean solution for deploying - so is there any way (Except switching to VSTO and fool arround with Ribbon and Taskpane at this end?) reading the config from the dll.config file? We do not have a manifest and or vsto file created (because our addin is not based on the VSTO) Using a configurationmanager and read everything manually by code and instantiate the binding is a bit cruel... any ideas?! thank you

¿Fue útil?

Solución

You can create your own app domain and configure it so that it automatically uses the config file, as you would expect under other app.config scenarios. Use AppDomain.Create with an AppDomainSetup with the ConfigurationFile property set to the path of your app.config.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top