TypeLoadException: Can't find property implementation.

F

Fredo

I'm getting the following error when I'm running my application (application
name changed for the example):

Unhandled Exception: System.TypeLoadException: Method get_ImageFile in type
MyApp.Plugin.DefaultImageFiles.JPEGImage from assembly
MyApp.Plugin.DefaultImageFiles, Version=1.0.2934.26057, Culture=neutral,
PublicKeyToken=null does not have an implementation.

My application is plugin-based. The class in question does have an
implementation of the ImageFile property with both a getter and setter. I've
verified that it is loading the proper version of the assembly from the
correct directory (it shows up in the Debug output with the path when it
loads the .DLL). I have verified, with reflector, that that copy of the DLL
does, in fact, have the implementation of the ImageFile property and yet, I
get the above exception when I try to call a method in the assembly.

The application, all of its DLLs, both plugin and otherwise, are all copied
to a single directory called "bin" by post-build events in all the projects
and the application is run in that directory.

JpegImage implements an interface called IMyAppImage. The interface
definition for the property is:

ImageFile ImageFile
{
get;
set;
}

(ImageFile is also a class defined in yet another assembly)

The implementation of the interface in JpegImage is simply:

public ImageFile ImageFile
{
get
{
return _imageFile;
}
set
{
_imageFile = value;
}
}

So, I'm stumped. Is there confusion being caused by the fact that the
property name is the same as a class name? I've never had that problem
before and I'd assume that the Size struct in System.Drawing would be
equally problematic if that were the case, since tons of classes implement
the property Size.

What else could be causing the problem?

Thanks.
 
F

Fredo

Nevermind. After hours of futzing with this, I finally discovered there was
a problem with one of the .DLLs. Please ignore the original post.
 

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