Using the GAC & combining assemblies

Aug 4, 2008 at 10:30 PM
I am evaluating the System.AddIn framework to see if it will suit our needs and I am very much on the fence.  The biggest problem that I have is looking at this from the perspective of a third-party developer that needs to integrate with our application.  Our current solution, which is very cumbersome and does not give us isolation, simply uses the file system to detect the dll's stored in the AddIns folder (or sub-folders) and uses reflection to make a type-check, etc. for discovery.  The only requirement that we impose on add-in development is that they reference our SDK library which is installed in the GAC and implement the interfaces provided.  Our code, again using reflection, is able to then call into the add-ins via these interfaces because the SDK library is also referenced by the application.

When considering the System.AddIn framework, we'd like to be able to put the assembly containing the add-in views in the GAC for easy access by third-party developers.  Is this possible?  Preliminary testing shows that the framework won't find the add-ins unless the add-in view assembly is in the AddInViews folder under the executable.  In fact, an exception is thrown if the "AddInViews" folder isn't there, which I find to be unacceptable.  Disable add-ins or something, but don't throw an exception!

While I am not thrilled with the dependancy upon the folder structure, I imagine we could work around that because I understand the flexibility it gives us as versions change.  But, I would still prefer to be able to have the add-in views in the GAC and at least the host view included directly into the main application assembly.  It is highly unlikely that one would change without a comparible change in the other.  The MSDN reference says that certain components in the pipeline can be combined into the same assembly (adapters & views) but doesn't explain where to put the comined assemblies nor does it give any indication that the host view can be combined with the host application.

Aug 14, 2008 at 4:55 AM
Hi SonOfPirate,

We do enforce a folder structure and the presence of all the pipeline assemblies on disk. However, that doesn't prevent you from adding the pipeline assemblies to the GAC as well, as long as you don't delete it from the folder on disk.

The reason the host view is a separate assembly is that it allows add-ins to be usable by more than one host.

If you do combine pipeline components, you'll have to copy the assembly into both locations on disk. However, we do recommend using a separate assembly for each pipeline component to ensure success when versioning any of the components.

Hope this helps clarify some things.