0

I am currently looking for a way to load a third party dll (telerik) missing for my prism module when this one is require into my shell.

I have created a boostrapper with a custom ModuleCatalog

My CustomModuleCatolog is in charge to find my modules dll flagged as IModule ans reference them into the managed catalogue.

This works fine.

The only problem is that, when my moduleA starts it will require Telerik.Windows.Controls.gridview. This dll is not referenced into the shell project. I do not want to have to reference not needed DLL into the shell project.

So I am getting an error because this dll is not loaded.

My question is:

Is there an elegant way to load all the third dll when needed by a module (only the missing one)?

Should I load this dependency directly from my CustomModuleCatalogue, or should I load this when my the IModule.Initialize is call? Is there another way to do it?

Thx in advance.

pix
  • 1,264
  • 19
  • 32

1 Answers1

1

I handle this by setting the modules' output folder to the same as the shell's. If one of my modules references something, it gets copied to the output and the module find's it at runtime.

If you has a seperate module folder, you will have to handle the AppDomain.AssemblyResolve event in your shell (see Resolve assembly references from another folder, for example).

Community
  • 1
  • 1
Haukinger
  • 10,420
  • 2
  • 15
  • 28
  • I really want to keep my module Inside a folder name Module/ModuleName1, Module/ModuleName2 etc... So what you recommand is to Watch AppDomain.CurrentDomain.AssemblyResolve from my shell project? I will give it a try :) – pix May 13 '16 at 08:47
  • I was looking at something like this, but I do not feel this is a the most elegent way to do it. :/ – pix May 13 '16 at 14:03