I have a problem with a module using a WCFservice. The service i configured in the config file of the module, and a custom behaviorextension is also defined there. The extension is defined in a common module assembly (called ClientLibrary), where there is
also a generic class to create a channelfactory based on the configurationfile of the module (using ConfigurationManager.OpenMappedExeConfiguration).
My problem is that when the channelfactory is created, I get a ConfigurationErrorsException (wrapped in a ModuleInitializeException) saying that the behaviorextension type cannot be loaded:
System.Configuration.ConfigurationErrorsException: The type 'NextGeneration.ClientLibrary.PathologyClientMessageInspectorExtensionElement, ClientLibrary' registered for extension 'PathologyMessageInspector' could not be loaded. (C:\ProgramData\Company\Modules\LoginModule.dll.config
The only way I can get around this, is to define the modulefolder (I use DirectoryModuleCatalog, and syncronize te module folder against a networkshare containing updated modules at application start) as a subdirectory to the application directory, and adding
the following to the shells config:
This however is not possible in production, since the module will be installed in programfiles folder, and the modulefolder should reside in Programdata folder.
Any comment would be much appreciated - I hope I do not have to add the behaviorextension programmatically when creating the channelfactory.