app.config for the plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anos atrás
Hey there, is there some special convention for using app.config for plugins? I've added system.serviceModel section with a binding and an endpoint but plugins doesn't seem to see it -

"Error: Could not find default endpoint element that references contract 'Service.ITransaction' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.."

That same configuration/code works just fine in a small console app.

plugin.dll.config does get deployed into plugin folder.

What am I doing wrong?

Thanks.
12 anos atrás
vladk wrote:
Hey there, is there some special convention for using app.config for plugins? I've added system.serviceModel section with a binding and an endpoint but plugins doesn't seem to see it -

"Error: Could not find default endpoint element that references contract 'Service.ITransaction' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.."

That same configuration/code works just fine in a small console app.

plugin.dll.config does get deployed into plugin folder.

What am I doing wrong?

Thanks.


Your service binding needs to go into the web.config. Since your plugin is not an application, but it is used by a web application the configuration will actually be loaded from the web.config (configuration for the web application).
12 anos atrás
Thanks, so there is no way for application to do additional config to the main web.config, right?

For wcf I can create stuff programmatically to keep it all embedded within a plugin but it would be nice to have separate plugin configuration.
12 anos atrás
vladk wrote:
Thanks, so there is no way for application to do additional config to the main web.config, right?

For wcf I can create stuff programmatically to keep it all embedded within a plugin but it would be nice to have separate plugin configuration.


You can programmatically create your service classes and you can store the custom configuration using a custom instance of "ISettings". These settings will be stored in the database, you can install them with the plugin, remove them when the plugin is uninstalled and it requires minimal programming. Alternatively you could write code to read up your own configuration file, but I wouldn't recommend that approach.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.