Extending Configuration.Console

Topics: Building and extending application blocks, Enterprise Library Core
Sep 23, 2007 at 1:35 PM
We have extended the enterprise library code so that the configuration can be stored in the database however we have come into some problems with assembly references.
We also need to use the Web Client Software factory that requires the strong named Enterprise library code. Therefore we can't really rebuild the Enterprise library and use
the non-strongly named libraries.

We have tried to separate out any extensions into separate projects rather than putting the code inside the Enterprise library code so that in the future we can upgrade to a
new version of the Enterprise library if we needed to. All of our new projects link to the strong named assemblies and work ok individually.

The sticking point has been the Configuration Console, in order to include the SQLConfigurationSource functionality into the console app we have had to edit the original
Enterprise library code so that it registers our SQLConfigurationSource functionality and adds in all the bits into the GUI so the user can create a new SQL Configuration Source
in the same way that the user creates the File Configuration Source etc. To achieve this we modified Configuration.Design.

We have set all the references in the Configuration.Console and Configuration.Design project to reference the strong named assemblies such as Common, caching, data, etc.
However doing this means that all of the strongly named assemblies try to reference the strongly named Configuration.Design, however as we have changed this file and not
have the strong name key we get an exception when the application runs as the the strongly named assembly for Configuration.Design can not be found.

If we change all the references in all the projects like common, caching, data, etc. to reference the projects in the Enterpirse Library solution rather than
the strongly named ones and run it from the solution then it works ok.

So what I am trying to work out is:
1. Have we extended the configuration.console right, i.e. updating the configuration.design to add in the hooks to make the SQL Configuration work.
2. Is there a way to get the Enterprise config console to work with all the strongly named apps except for Configuration.Console and Configuration.Design
3. Is there any alternative way of extending the console, i.e. adding in a reference to a custom assembly in the app.config file.

Thanks
Sep 24, 2007 at 12:18 PM
Edited Sep 24, 2007 at 12:22 PM
Hi,


1. Have we extended the configuration.console right, i.e. updating the configuration.design to add in the hooks to make the SQL Configuration work.

It shouldn't be necessary to update the core block in order to add new functionality. You need to have a new Design assembly for your extension, add a ConfigurationDesignManager to it and make the design manager register both the commands and the node mappings. You can see an isolated example of this in the manageability extensions http://www.codeplex.com/entlib/Release/ProjectReleases.aspx?ReleaseId=1340, in the project extensions/manageability/src/Common/Configuration/Design/Common.Configuration.Design.csprj. This was written for v2, but it should work for v3 with minor modificationos (there were some changes around configuration encryption).


2. Is there a way to get the Enterprise config console to work with all the strongly named apps except for Configuration.Console and Configuration.Design

No, because the types the signed design time assemblies depend on would be different from the core unsigned Configuration.Design types. You could however, assuming you still need this, create unsigned versions of all the design time assemblies that reference the signed binaries. I.e. your new solution would only have design time projects.


3. Is there any alternative way of extending the console, i.e. adding in a reference to a custom assembly in the app.config file.

Not sure what you mean here.

Hope this helps,
Fernando