locked
System.InvalidCastException RRS feed

  • Question

  • Hi,

    I am receiving following exception during run time while fetching a property called from .net application. The property is implemented in a COM dll. This is the first time i am receiving such error since there is no changes made in our application or COM dll

    appDomain_UnhandledException: System.InvalidCastException: Unable to cast object of type 'XYZLib.ABCClass' to type 'XYZLib.IABC'.

       at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)

    I have gone through several forums but couldn't find any solution or the root cause for this exception.Any help would be really appreciated.

    Tuesday, May 26, 2015 6:27 AM

All replies

  • It looks like you're getting an object back that doesn't implement the COM interface you were expecting. Without any code showing what you're doing and how the COM component is implemented we aren't going to be much help.

    Michael Taylor
    http://blogs.msmvps.com/p3net

    Tuesday, May 26, 2015 5:10 PM