Subscribe to:
Post Comments (Atom)
Beyond Toughness: Why Your Car's Brain Needs AEC-Q100 AND ASIL-B
AEC-Q100 vs. ASIL-B: Quality Meets Safety In the era of autonomous driving and electric vehicles, the electron...
-
This will create a certification file and send to free certification authority " https://certbot.eff.org " sponsored by linux foun...
-
Annual Technical Conference 2006 of IET-YMS Sri Lanka, 16 th October 2010 Department of Electrical and Information Engineering, University ...
-
Installing MPICH2 parallel computing from package manager or Ubuntu software center, will need lot configurations of available real processo...
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
ReplyDeleteCode:
ContactInfo contactInfo = new ContactInfo();
Contact contact = new Contact();
contactInfo = contact.Load(this.ContactID.Value);
Any help would be much appreciated.
actually this is not a bug. its a problem with the version changes of your own project! because your final run don't use the original imported references on compile!
ReplyDeletefor example,
i was making a chat server, client. i used a packet structure to transmit data on client project. then imported the same reference to server project. when casting...
Packet packet = (Packet)binaryFormatter.Deserialize(stream);
i got the same error.because the actual running reference at server project is not the reference now at client project! because i have rebuilt client project many times after!
in casting .... =()
always the new object need to be a newer or same version as the old object!
so what i did was, i build a separate project to create a dll for the Packet class and imported the dll file to both projects. if i did any change to Packet class, i have to import the reference to both client and server again.
then the casting wont give above exception!
regards!