Inaccessable interface error...

C

cmelnick

I created an interface, IMyInterface and placed it in namespace
MyPackage. Something like this:

namespace MyPackage {
interface IMyInterface {
// Stuff
}
}

This interface as well as some other stuff gets built into a DLL.

Another class in namespace MyPackage.GUI (not in the DLL) needs to
implement the IMyInterface interface. On compiling, I got an
inaccessable class error. This is obviously because I didn't make the
interface public...

OK, so I made the interface public, and recompiled. Worked great.
However, upon running it, I get a System.TypeLoadException when it
tries to create an instance of an object that implements IMyInterface.
"Couldn't load IMyInterface from assembly lib.dll". I viewed the dll
in an dll examiner program, and it says the IMyInterface is there and
is public.

What am I doing wrong?
 
J

Joshua Flanagan

Did you deploy the DLL that contains the IMyInterface definition along
with the rest of the application? Make sure the assembly is being
loaded correctly. Check the Fusion Log Viewer. Make sure you have your
binding information correct (is anything strong named, are the versions
correct, etc).
 

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