Reflection issue with a plug in project.

D

DeveloperX

I've knocked up a quick plug in project (actually it's 6 projects, but
more on that in a moment).

This project is referenced by a shared add in (used for Excel).

The issue I have is that when I iterate through the DLL's in the plug
in's directory, when it finds my plug in dll it claims there are no
types in the assembly.

Assembly assembly = Assembly.LoadFile(pDllName);
foreach (Type type in assembly.GetTypes())
{

Here GetTypes() returns no types. However it does not throw an
exception so it does appear to have loaded the assembly.

The assembly contains one class PluginA which derives from a base
class in a seperate project called PluginBase. PluginBase implements
an interface IPlugin which is in a third assembly.

so we have:

public class PluginA : Plugin.PluginBase

public abstract class PluginBase : MarshalByRefObject, IPlugin

public interface IPlugin

This is running (or not as the case seems to be) under framework 1.1.

I'm slightly baffled, I've done similar things before and not
experienced this, I'm guessing it's related to the heirarchy, but I'm
just not sure. If there's any extra info I can provide please ask.

Thanks
 
D

DeveloperX

Ok, think I've cracked it, although I'm not sure why. Will investigate
that once I've got the rest of the bugs ironed out :)
I replaced the call to Assembly.LoadFile with Assembly.LoadFrom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top