Unable to cast object of type MyObject to type MyObject

Posted by Robert W on Stack Overflow See other posts from Stack Overflow or by Robert W
Published on 2009-09-17T15:50:05Z Indexed on 2010/04/09 1:13 UTC
Read the original article Hit count: 373

Filed under:
|

I have this scenario where a webservice method I'm consuming in C# returns a Business object, when calling the webservice method with the following code I get the exception "Unable to cast object of type ContactInfo to type ContactInfo" in the reference.cs class of the web reference

Code:

ContactInfo contactInfo = new ContactInfo();
Contact contact = new Contact();

contactInfo = contact.Load(this.ContactID.Value);

Any help would be much appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about web-services