MSDN help on the topic could look a bit misleading.
Did you see this code sample:
The problem is that the crash happens before
the handler of
even is added to the event invocation list, before start of main.
So, it looks like this schema does not really work. (Maybe it need some more research.)
I would consider well-working alternative: using dynamically loaded assemblies.
Please see this:
Create WPF Application that uses Reloadable Plugins...
AppDomain refuses to load an assembly
Some designs I described in the above Solutions are overly difficult or problematic. In your case you need the simplest of the cases: non-reloadable (loaded-once) plug-in, which is really simple.
You can use a simple extra trick: my schema suggests you create a plug-in interface, but you don't want to add any shared libraries (you want all the libraries in one place, found by application). You can put this interface in the application: an application assembly (in EXE file) can be loaded exactly as a library, referenced by other assembly.
It was interesting exercise.
As we face such difficulties, let's do something more realistic.
Don't you think you over-estimated the hassle of application
? Did you use
option? Look at this sample file:
It means that I place this file with my application in some directory, and all my library assemblies are put in its sub-directory "
", they are shared by some set of my applications and are automatically resolved under this sub-directory. It does not have to be a sub-directory, can be somewhere on top of directory structure.