I plan to have optional components (dll files) in my app and would like to know how I can tell if they are installed. I don't want to look for a file name because it might be the wrong version. I don't want to limit myself to the same folder as the executing assembly because I know .NET might find the assembly in the GAC.
I know that I can get the references through Assembly.GetReferencedAssemblies() but what I don't know is what to do with them.
The only solution that I can see is to pass the AssemblyName array off to Assembly.Load and then eat the exception that occurs when .NET cannot find them. I'd rather not have the lag that this would entail though because all I am doing is enabling and disabling parts of the UI based on what is installed.
I've also tried binding to the AppDomain.AssemblyResolve event but this only seems to fire when satellite assemblies are resolved, not when external class libraries are resolved contrary to the documentation.
I know that I can get the references through Assembly.GetReferencedAssemblies() but what I don't know is what to do with them.
The only solution that I can see is to pass the AssemblyName array off to Assembly.Load and then eat the exception that occurs when .NET cannot find them. I'd rather not have the lag that this would entail though because all I am doing is enabling and disabling parts of the UI based on what is installed.
I've also tried binding to the AppDomain.AssemblyResolve event but this only seems to fire when satellite assemblies are resolved, not when external class libraries are resolved contrary to the documentation.