By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,611 Members | 1,647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,611 IT Pros & Developers. It's quick & easy.

TypeLoadException: Can't find property implementation.

P: n/a
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.

Jan 13 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nevermind. After hours of futzing with this, I finally discovered there was
a problem with one of the .DLLs. Please ignore the original post.
"Fredo" <fr***@hotmail.comwrote in message
news:Et******************************@giganews.com ...
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.

Jan 13 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.